[Issue 8512] Nasty bug about template

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Dec 12 22:08:30 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=8512



--- Comment #1 from Kenji Hara <k.hara.pg at gmail.com> 2012-12-12 22:08:20 PST ---
I think this code has a forward reference error, so cannot compile.

The starting of forward reference is here.
template temp1(){
    template temp(T){
        alias Result!(Tuple!()) Type;
        pragma(msg, seq!(T, temp2!(), temp2!()));  // bad
    }
}

And the dependencies direction is:
1. temp1!().temp!int             instantiates temp2!()
2. temp2!()                      instantiates seq!(int, temp1!(), temp2!()))
3. seq!(int, temp1!(), temp2!()) instantiates TempType!(int, temp1!())  (at
[2])
4. TempType!(int, temp1!())      instantiates temp1!().temp!int

1 to 4 makes forward reference.

In current dmd implementation, pragma(msg) requires *complete entities* for its
arguments. It means that all semantic analysis for them are already done.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list