Bug 8976 – __traits(compiles, ...) causes error

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-11-08T03:09:00Z
Last change time
2012-11-09T02:45:57Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
verylonglogin.reg

Comments

Comment #0 by verylonglogin.reg — 2012-11-08T03:09:06Z
Marked as a regression as previously (commit 16dbc68bc30ba65b24f265577e8ffa626ac9698e) compiler worked correctly for code from which is is reduced. For this example code, compiler never worked correctly as previously it failed `static assert`: --- void f(ref int) { } void g()() { f(0); // line 5 } void h()() { g!()(); } static assert(!__traits(compiles, h!()())); // causes error --- Errors: --- main.d(5): Error: function conv2.f (ref int) is not callable using argument types (int) main.d(5): Error: constant 0 is not an lvalue ---
Comment #1 by k.hara.pg — 2012-11-08T06:56:37Z
Comment #2 by k.hara.pg — 2012-11-08T06:58:25Z
Comment #3 by github-bugzilla — 2012-11-08T23:53:55Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/3f6c72cc46c05c43071b3a7131774fab3c177f15 fix Issue 8976 - __traits(compiles, ...) causes error https://github.com/D-Programming-Language/dmd/commit/0ddd9a430cef86aba8f94c158cafc3042bda5040 Merge pull request #1269 from 9rnsr/fix8976 Issue 8976 - __traits(compiles, ...) causes error