[Issue 3616] __traits(compiles) returns true for uncompilable code due to static assert

2015-06-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=3616

Andrei Alexandrescu and...@erdani.com changed:

   What|Removed |Added

Version|2.036   |D2

--


[Issue 3616] __traits(compiles) returns true for uncompilable code due to static assert

2012-01-01 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3616


Denis verylonglogin@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||verylonglogin@gmail.com
 Resolution||INVALID


--- Comment #1 from Denis verylonglogin@gmail.com 2012-01-01 13:37:37 MSK 
---
Assertion in `foo` should fail because `foo` is a regular function and compiles
independently of assertion in `main`. This code compiles:
---
void foo()() { static assert(false); }
void main()  { static assert(!__traits(compiles, foo!()())); }
---

Note, that due to bug 3448 __traits(compiles) works correctly only if it is in
a function.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---