Bug 7848 – pure and nothrow ignored on unittest blocks
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-04-06T22:43:00Z
Last change time
2013-06-07T21:08:07Z
Keywords
accepts-invalid, pull
Assigned to
nobody
Creator
issues.dlang
Comments
Comment #0 by issues.dlang — 2012-04-06T22:43:59Z
This code compiles when it shouldn't:
void main()
{
}
void func()
{
}
pure unittest
{
func();
}
func is impure and should cause the compilation of the unittest block to fail. It fails if you mark it as @safe (since func is @system), but it doesn't fail for pure.