Summary: __traits(compiles, ...) fails when given a template
                    property function without parens
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Jonathan M Davis <> 2011-01-07 21:13:49 
PST ---
This fails to compile:

struct S
    @property T func(T)()
        return T.init;

void main()
    S s;
    static assert(__traits(compiles, s.func!int));

and gives this error:

test.d(13): Error: static assert  (__traits(compiles,s.func!(int))) is false

If you change s.func!int to s.func!int() in the __traits statement, then it
compiles. But while the program itself can handle s.func!int, __traits can't.
It needs the parens. And as soon as properties are fixed so that they _can't_
be called with parens, then this will be that much more of a problem.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to