January 08, 2011 [Issue 5425] New: __traits(compiles, ...) fails when given a template property function without parens | ||||
---|---|---|---|---|
| ||||
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: nobody@puremagic.com ReportedBy: jmdavisProg@gmx.com --- Comment #0 from Jonathan M Davis <jmdavisProg@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: ------- |
May 31, 2012 [Issue 5425] __traits(compiles, ...) fails when given a template property function without parens | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jonathan M Davis | http://d.puremagic.com/issues/show_bug.cgi?id=5425 Kenji Hara <k.hara.pg@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED --- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> 2012-05-30 22:01:23 PDT --- Works in 2.060head. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation