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

           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
        AssignedTo: nob...@puremagic.com
        ReportedBy: jmdavisp...@gmx.com


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

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

void main()
{
    S s;
    s.func!int;
    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: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to