[Issue 1099] New: weird tupleof behavior in mixins

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Apr 5 19:10:27 PDT 2007


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

           Summary: weird tupleof behavior in mixins
           Product: D
           Version: 1.010
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: h3r3tic at mat.uni.torun.pl


the following module should not compile, but it does. Tested with dmd 0.175,
1.010 and 1.010b.



template Mix(int a) {
        alias typeof(*this) ThisType;
        static assert (ThisType.init.tupleof.length == a);
}


struct Foo {
        mixin Mix!(0);
        int foo;
        mixin Mix!(1);
        int bar;
        mixin Mix!(2);
}


-- 



More information about the Digitalmars-d-bugs mailing list