Bug 9017 – __traits(compiles, { enum e = <expression tuple>; }) is true but code doesn't compile

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-11-12T23:27:00Z
Last change time
2013-08-17T23:33:29Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
verylonglogin.reg

Comments

Comment #0 by verylonglogin.reg — 2012-11-12T23:27:10Z
--- template X(Args...) { static if(__traits(compiles, { enum e = Args; })) enum e = Args; } alias X!0 X0; // line 7 --- Output: --- main.d(7): Error: cannot cast int to (int) main.d(7): Error: template instance main.X!(0) error instantiating ---
Comment #1 by k.hara.pg — 2013-08-11T04:41:51Z
Comment #2 by k.hara.pg — 2013-08-12T07:54:24Z
*** Issue 10803 has been marked as a duplicate of this issue. ***
Comment #3 by github-bugzilla — 2013-08-17T23:31:45Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/435af3171f488c7857c2d2859c1c99981de19506 fix Issue 9017 - __traits(compiles, { enum e = <expression tuple>; }) is true but code doesn't compile https://github.com/D-Programming-Language/dmd/commit/558fffad139416b48eb05a58be05b6c7e2364519 Merge pull request #2464 from 9rnsr/fix9017 Issue 9017 - __traits(compiles, { enum e = <expression tuple>; }) is true but code doesn't compile