Bug 6352 – Regression(2.054) Implicit pure/nothrow/@safe messes up delegate arrays

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-07-19T21:00:00Z
Last change time
2011-09-16T23:28:30Z
Keywords
patch, rejects-valid
Assigned to
nobody
Creator
bus_dbugzilla
Depends on
3180

Comments

Comment #0 by bus_dbugzilla — 2011-07-19T21:00:27Z
pure: ------------- int a; void main() { void delegate()[] dgArray = [ () {}, () { a = 1; } ]; } ------------- testDgArray1.d(7): Error: incompatible types for ((__dgliteral1) ? (__dgliteral2)): 'void delegate() pure nothrow @safe' and 'void delegate() nothrow @safe' ================================== nothrow: ------------- void main() { void delegate()[] dgArray = [ () {}, () { throw new Exception(""); } ]; } ------------- testDgArray2.d(6): Error: incompatible types for ((__dgliteral1) ? (__dgliteral2)): 'void delegate() pure nothrow @safe' and 'void delegate() pure @safe' ================================== @safe: ------------- void main() { void delegate()[] dgArray = [ () {}, () { *(cast(int*)0) = 1; } ]; } ------------- testDgArray3.d(6): Error: incompatible types for ((__dgliteral1) ? (__dgliteral2)): 'void delegate() pure nothrow @safe' and 'void delegate() pure nothrow @system'
Comment #1 by yebblies — 2011-07-19T21:25:43Z
This is essentially issue 3180, but the regression part is of course new. Maybe 3180 should be elevated to regression? I'm not really sure. I have a patch for this, but I'm waiting for my fix to issue 3797 to be applied first.
Comment #2 by bus_dbugzilla — 2011-07-19T21:30:20Z
I'll mark this as depending on issue 3180. That should be good enough. Other parts of 3180 aren't regressions, after all.
Comment #3 by yebblies — 2011-09-02T06:12:18Z
Comment #4 by yebblies — 2011-09-08T06:41:34Z
The fix for issue 3180 fixes this bug. https://github.com/D-Programming-Language/dmd/pull/368
Comment #5 by bugzilla — 2011-09-16T23:28:30Z