[Issue 12704] New: typeof function literal incorrectly infers attributes
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Mon May 5 12:53:44 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=12704
Issue ID: 12704
Summary: typeof function literal incorrectly infers attributes
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: enhancement
Priority: P1
Component: DMD
Assignee: nobody at puremagic.com
Reporter: code at dawg.eu
cat > bug.d << CODE
void foo() @system;
alias FuncLitT = typeof(function() { foo(); });
static assert(is(FuncLitT == void function() @system));
CODE
dmd -c bug
----
bug.d(3): Error: static assert (is(void function() pure @safe == void
function() @system)) is false
----
Interestingly nothrow is inferred correctly, only pure and @safe are broken.
Might be related to bug 12561.
--
More information about the Digitalmars-d-bugs
mailing list