[Issue 945] template forward reference with named nested struct only

Manuel König manuelk89 at gmx.net
Sat Feb 10 09:24:23 PST 2007


d-bugmail at puremagic.com schrieb:
> http://d.puremagic.com/issues/show_bug.cgi?id=945
> 
> 
> smjg at iname.com changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                  CC|                            |smjg at iname.com
>            Keywords|                            |rejects-valid
> 
> 
> 
> 
> ------- Comment #1 from smjg at iname.com  2007-02-10 10:30 -------
> Interesting.  Neither
> 
>     dmd A.d B.d
>     dmd B.d A.d
> 
> shows the problem (trying it under Win98SE).  But what puzzles me most is that
> in your attempt, the compiler prints "x" instead of a line number.
> 
> 

I just used "x" because I didn´t want to count the line numbers and the 
lines are shifted in my bug report.

But the behaviour of "dmd A.d B.d" and vice versa is very interesting, 
cause manually invoking the compiler with theses lines runs for me too 
(thanks for the hint!). But both Code::Blocks and 'bud' failed. Under 
Code::Blocks with full command line logging enabled it says:

dmd.exe  -I\include -IC:\dmd\src\phobos  -c D:\Dev\Projects\DError\B.d 
-ofobj\Release\B.obj
dmd.exe  -I\include -IC:\dmd\src\phobos  -c D:\Dev\Projects\DError\A.d 
-ofobj\Release\A.obj
dmd.exe bin\Release\DError.exe  obj\Release\B.obj obj\Release\A.obj 
phobos.lib
B.d(6): struct B.T!().T.Nested has forward references
B.d(11): template instance B.T!() error instantiating
Process terminated with status 1 (0 minutes, 0 seconds)
2 errors, 0 warnings

I tried to reproduce the error Code::Blocks ran into, but running the 
same lines from a batch file works!
The same error appears by doing 'bud A' (but not 'bud B'!).

Can anybody explain this strange behaviour?


More information about the Digitalmars-d-bugs mailing list