Bug 12561 – typeof function literal doesn't check @safe
Status
RESOLVED
Resolution
DUPLICATE
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2014-04-11T20:27:00Z
Last change time
2015-06-09T05:15:16Z
Keywords
safe
Assigned to
nobody
Creator
code
Comments
Comment #0 by code — 2014-04-11T20:27:10Z
cat > bug.d << CODE
struct Sunsafe { this(this) @system pure nothrow {} }
pragma(msg, typeof(() @safe { Sunsafe a = Sunsafe.init, b = a; }));
CODE
dmd -c bug.d
----
void function() pure nothrow @safe
----
As semantic of the function fails the type should be _error_.
Comment #1 by crunchengine — 2014-04-12T13:05:28Z
Hi,
I'm trying to discover dmd internals while exploring some bugs, and for this one, i think typeof expressions are speculative so that no semantic pass does not apply, am i wrong ?
Bon courage.
Comment #2 by k.hara.pg — 2014-06-20T03:29:27Z
Fixed in 2.066 git-head.
*** This issue has been marked as a duplicate of issue 12704 ***