[Issue 6352] New: Regression(2.054) Implicit pure/nothrow/@safe messes up delegate arrays
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Jul 19 21:05:46 PDT 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6352
Summary: Regression(2.054) Implicit pure/nothrow/@safe messes
up delegate arrays
Product: D
Version: D2
Platform: Other
OS/Version: Windows
Status: NEW
Keywords: rejects-valid
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: cbkbbejeap at mailinator.com
--- Comment #0 from Nick Sabalausky <cbkbbejeap at mailinator.com> 2011-07-19 21:00:27 PDT ---
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'
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list