www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1099] New: weird tupleof behavior in mixins

reply d-bugmail puremagic.com writes:
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 digitalmars.com
        ReportedBy: h3r3tic 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);
}


-- 
Apr 05 2007
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1099


thomas-dloop kuehne.cn changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         OS/Version|Windows                     |All





Added to DStress as
http://dstress.kuehne.cn/nocompile/t/tupelof_01_A.d
http://dstress.kuehne.cn/nocompile/t/tupelof_01_B.d


-- 
Apr 06 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1099






Perhaps D is designed to work this way? Mixin template instances also don't see
fields declared after their mixing-in point, so it's kind of consistent... But
pretty weird/confusing anyway.


-- 
Jun 28 2008
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1099




Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/9024f3680dc69edc20268cbcd7277016d165641d
Fix issue 1099 weird tupleof behavior in mixins

Fixed some time ago, this is just the test case

https://github.com/D-Programming-Language/dmd/commit/85c54827db14f5a547015ab4a19fdd677f5449aa


Fix issue 1099 weird tupleof behavior in mixins

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 14 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1099


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED


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