digitalmars.D.bugs - [Issue 6732] New: static assert fails on true expression
- d-bugmail puremagic.com (35/35) Sep 26 2011 http://d.puremagic.com/issues/show_bug.cgi?id=6732
- d-bugmail puremagic.com (27/27) Jan 04 2012 http://d.puremagic.com/issues/show_bug.cgi?id=6732
- d-bugmail puremagic.com (13/13) Jan 06 2012 http://d.puremagic.com/issues/show_bug.cgi?id=6732
http://d.puremagic.com/issues/show_bug.cgi?id=6732 Summary: static assert fails on true expression Product: D Version: D2 Platform: Other OS/Version: Windows Status: NEW Keywords: rejects-valid Severity: major Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: andrej.mitrovich gmail.com --- Comment #0 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2011-09-26 09:14:17 PDT --- template isDouble(T) { enum bool isDouble = __traits(hasMember, T, "x") || is(T == double); } void test(T)(T rhs) if (is(T == int)) { } void test(T)(T rhs) if (isDouble!T) { } void main() { static assert(__traits(compiles, test(4.5))); // fail test(4.5); // fine } If you comment out the static assert you'll see that the test() call compiles. Oddly enough if you swap the order of the calls like so: void main() { test(4.5); static assert(__traits(compiles, test(4.5))); } Then it works again. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Sep 26 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6732 Andrej Mitrovic <andrej.mitrovich gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|rejects-valid | Summary|__traits(compiles) fails on |ICE: __traits(compiles) |valid expression |fails on valid expression --- Comment #1 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2012-01-04 06:55:23 PST --- The following has now turned into an ICE (is a crash equivalent to an ICE?) in 2.057: template isDouble(T) { enum bool isDouble = __traits(hasMember, T, "x"); } void test(T)(T rhs) if (isDouble!T) { } void main() { test(4.5); } --------------------------- dmd.exe - Application Error --------------------------- The instruction at "0x00489e61" referenced memory at "0x00000000". The memory could not be "read". -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 04 2012
http://d.puremagic.com/issues/show_bug.cgi?id=6732 Kenji Hara <k.hara.pg gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED --- Comment #2 from Kenji Hara <k.hara.pg gmail.com> 2012-01-06 07:35:49 PST --- ICE problem on comment#1 was fixed in bug 7108. And the original problem on comment#0 was fixed in bug 7123. Finally this issue was completely fixed in 2.058head. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 06 2012