[Issue 19635] New: -checkaction=context not working with attributes
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Jan 30 21:37:47 UTC 2019
https://issues.dlang.org/show_bug.cgi?id=19635
Issue ID: 19635
Summary: -checkaction=context not working with attributes
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: major
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: doob at me.com
The new "-checkaction=context" flag available in master doesn't work with
attributes like @safe, @nogc or "pure". Example:
void main() @safe pure @nogc
{
int a;
assert(a == 0);
}
The above code fails to compile with the following errors:
Error: pure function D main cannot call impure function
object._d_assert_fail!("==", int, int)._d_assert_fail
main.d(1): Error: @safe function D main cannot call @system function
object._d_assert_fail!("==", int, int)._d_assert_fail
./generated/osx/release/64/../../../../../druntime/import/object.d(4822):
object._d_assert_fail!("==", int, int)._d_assert_fail is declared here
main.d(1): Error: @nogc function D main cannot call non- at nogc function
object._d_assert_fail!("==", int, int)._d_assert_fail
--
More information about the Digitalmars-d-bugs
mailing list