www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7721] New: Loss of template context when passed as template template parameter

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

           Summary: Loss of template context when passed as template
                    template parameter
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: simen.kjaras gmail.com



PDT ---
module baz;

template Foo(alias T) {
    mixin T.Baz!();
}

template Bar(U) {
    template Baz( ) {
        U n;
    }
}

void main( ) {
    mixin Foo!(Bar!int);
}

Yields the error messages:

baz.d(9): Error: undefined identifier U, did you mean variable n?
baz.d(4): Error: mixin baz.main.Foo!(__T3BarTiZ).Baz!() error instantiating
baz.d(14): Error: mixin baz.main.Foo!(__T3BarTiZ) error instantiating

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