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.