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

           Summary: Class members as template alias parameters not
                    CTFE-able
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: [email protected]
        ReportedBy: [email protected]


--- Comment #0 from Johannes Pfau <[email protected]> 2013-07-23 23:56:33 
PDT ---
Test case:
------------------------
class TestClass
{
    int a;
    this()
    {
        enum c = getAttribute!(TestClass.a);
    }
}

int getAttribute(alias target)()
{
    return 0;
}
------------------------
produces this error in DMD 2.063:
Error: value of 'this' is not known at compile time

This is annoying as you can use e.g. __traits(getAttributes, TestClass.a) but
you can not wrap this call into a template because of this bug.

A workaround as mentioned by Andrej Mitrovic is adding static to the
getAttribute template declaration.

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

Reply via email to