657 – version(): ignored

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 657 - version(): ignored
Summary: version(): ignored
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: Walter Bright
URL:
Keywords: accepts-invalid
Depends on:
Blocks:
Reported: 2006年12月06日 16:33 UTC by Carlos Santander
Modified: 2015年06月09日 05:14 UTC (History)
2 users (show)

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Carlos Santander 2006年12月06日 16:33:42 UTC
This compiles successfully, but I don't think it should.
//---------
void bar ()
{
 foo (); // should fail
}
version(none):
void foo () {}
//---------
$ gdmd -c test.d
//---------
Comment 1 Anders F Bj 2006年12月07日 08:41:06 UTC
There is an error with that extra colon, after the version:
version(none)
void foo () {}
none.d:3: undefined identifier foo
none.d:3: function expected before (), not foo of type int
version(none)
{
void foo () {}
}
none.d:3: undefined identifier foo
none.d:3: function expected before (), not foo of type int
However, maybe having the colon should be made an error ?
Comment 2 Carlos Santander 2006年12月07日 08:50:48 UTC
(In reply to comment #1)
> There is an error with that extra colon, after the version:
> 
> version(none)
> void foo () {}
> 
> none.d:3: undefined identifier foo
> none.d:3: function expected before (), not foo of type int
> 
> version(none)
> {
> void foo () {}
> }
> 
> none.d:3: undefined identifier foo
> none.d:3: function expected before (), not foo of type int
> 
> However, maybe having the colon should be made an error ?
> 
I know. This bug is actually very old, but has been ignored:
2004年10月06日: http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=2039
2004年12月31日: http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=2631
2006年06月20日: http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=7625 
Comment 3 Thomas Kühne 2006年12月30日 20:10:23 UTC
This is an issue with DMD's frontend/documentation and not specific to GDC.
Comment 4 Walter Bright 2007年07月01日 13:27:45 UTC
Fixed DMD 1.018 and DMD 2.002


AltStyle によって変換されたページ (->オリジナル) /