[Issue 7717] New: Regression(2.059): typeof(this) incorrect in mixin template

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Mar 15 17:05:08 PDT 2012


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

           Summary: Regression(2.059): typeof(this) incorrect in mixin
                    template
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: thecybershadow at gmail.com


--- Comment #0 from Vladimir Panteleev <thecybershadow at gmail.com> 2012-03-15 17:05:19 PDT ---
template IsValid(T)
{
    enum IsValid = is(typeof(T.init.x));
}


mixin template T()
{
    static assert(IsValid!(typeof(this)));
}

struct S
{
    int x;
    mixin T;
}

The IsValid template is not necessary to reproduce the problem - it's for
illustration.

This also fails:
    static assert(is(typeof(typeof(this).init.x)));
But not this:
    static assert(is(typeof(x)));

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