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

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