Bug 6902 – Different "pure nothrow int()" types

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2011-11-07T01:43:00Z
Last change time
2013-01-21T23:02:46Z
Keywords
patch, rejects-valid
Assigned to
nobody
Creator
verylonglogin.reg

Comments

Comment #0 by verylonglogin.reg — 2011-11-07T01:43:54Z
--- void main() { static assert(is(typeof({ return int.init; // int, long, real, etc. }))); int f() pure nothrow { assert(0); } alias int T() pure nothrow; static if(is(typeof(&f) DT == delegate)) { static assert(is(DT* == T*)); // ok // Error: static assert (is(pure nothrow int() == pure nothrow int())) is false static assert(is(DT == T)); } } ---
Comment #1 by clugdbug — 2011-11-07T03:21:28Z
I thought we got rid of those crazy function types. Seems that they've survived in alias declarations somehow. The declaration of T shouldn't compile.
Comment #2 by k.hara.pg — 2011-11-07T03:33:51Z
Good reducing! I found a function/delegate literal type inference bug. I have done Phobos unit tests with my patch, and this resolves Phobos build breaking in Windows. http://d.puremagic.com/test-results/test_data.ghtml?dataid=113170 Please wait the patch a while.
Comment #3 by k.hara.pg — 2011-11-07T04:35:15Z
Comment #4 by k.hara.pg — 2011-11-14T04:46:51Z
Comment #5 by code — 2013-01-16T21:26:47Z
*** Issue 6600 has been marked as a duplicate of this issue. ***
Comment #6 by code — 2013-01-16T21:28:49Z
cat > bug.d << CODE void a() { function void() { }(); } void b() { static void safe_nothrow() @safe nothrow pure { } auto f = &safe_nothrow; enum mangle = typeof(*f).mangleof; static assert(mangle == "FNaNbNfZv", mangle); } CODE dmd -c bug ---- I've actually found a new failing test case for this.
Comment #7 by code — 2013-01-16T21:39:05Z
*** Issue 3796 has been marked as a duplicate of this issue. ***
Comment #8 by k.hara.pg — 2013-01-21T23:02:46Z
(In reply to comment #6) > cat > bug.d << CODE > void a() > { > function void() { }(); > } > > void b() > { > static void safe_nothrow() @safe nothrow pure { } > auto f = &safe_nothrow; > enum mangle = typeof(*f).mangleof; > static assert(mangle == "FNaNbNfZv", mangle); > } > CODE > > dmd -c bug > > ---- > > I've actually found a new failing test case for this. It is a dup of bug 8504. Pull #1096 will fix the issue.