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: [email protected]
Reporter: [email protected]
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.
--