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

Manuel König manuelk89 at gmx.net
Sat Feb 10 09:45:09 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.
> 
> 

This is very embarrissing, but I just forgot the instantiation of the 
template! It should be:

// file A.d:

    import B;

    struct S { }

// file B.d:

    import A;

    struct T()
    {
       struct Nested
       {
          S member;
       }
    }

    alias T!() instance; // <- add this line!!


This should finally reproduce the error!


More information about the Digitalmars-d-bugs mailing list