[Issue 7780] New: Template mixin'd members do not properly overload

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Mar 25 15:21:08 PDT 2012


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

           Summary: Template mixin'd members do not properly overload
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: simen.kjaras at gmail.com


--- Comment #0 from Simen Kjaeraas <simen.kjaras at gmail.com> 2012-03-25 15:21:31 PDT ---
mixin template A( ) {
    template C( int n : 0 ) {
        int C = 0;
    }
}

mixin template B( ) {
    template C( int n : 1 ) {
        int C = 1;
    }
}

class Foo {
    mixin A!( );
    mixin B!( );
}

void main( ) {
    assert( Foo.C!0 == 0 );
}

foo.d(19): Error: __overloadset isn't a template

Or (without the wrapping class):

foo.d(17): Error: template instance C!(0) ambiguous template declaration
foo.B!().C(int n : 1) and foo.A!().C(int n : 0)

The two versions of C here introduced could clearly coexist and be referred to
as Foo.C!0 and Foo.C!1.

-- 
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