[Issue 19549] New: -check=in=off doesn't work
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Jan 4 16:23:48 UTC 2019
https://issues.dlang.org/show_bug.cgi?id=19549
Issue ID: 19549
Summary: -check=in=off doesn't work
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: critical
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: greensunny12 at gmail.com
// REQUIRED_ARGS: -check=in=off -check=invariant=off
// PERMUTE_ARGS:
class C
{
int foo(int a)
in { assert(a != 0); } // skipped
out(res) { assert(res != 0, "out"); } // triggered
body
{
return a;
}
invariant // skipped
{
assert(false);
}
}
void main()
{
import core.exception : AssertError;
auto c = new C;
bool catched;
try
c.foo(0);
catch (AssertError e)
{
assert(e.msg == "out");
catched = e.msg == "out";
}
if (!catched)
assert(0);
}
--
More information about the Digitalmars-d-bugs
mailing list