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

           Summary: `__traits(parent, ...)` isn't parsed as type
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: [email protected]
        ReportedBy: [email protected]


--- Comment #0 from Denis Shelomovskij <[email protected]> 2013-04-30 
18:13:49 MSD ---
---
class C { int i; }

static assert(is(__traits(parent, C.i) == C)); // Error (line 3)

template Id(T){ alias Id = T; }
static assert(is(Id!(__traits(parent, C.i)) == C)); // OK
---

dmd output:
---
main.d(3): Error: basic type expected, not __traits
main.d(3): Error: found '__traits' when expecting ')'
main.d(3): Error: found ')' when expecting ';'
---

Workaround:
Use `Id` template.

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

Reply via email to