Bug 16967 – No switch case fallthrough warnings in in/out contracts
Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2016-12-12T15:41:00Z
Last change time
2017-01-16T23:25:48Z
Assigned to
nobody
Creator
benpnz
Comments
Comment #0 by benpnz — 2016-12-12T15:41:34Z
Switch case fallthrough warnings are not generated for code in in/out contracts.
-----
import std.stdio;
void main()
{
auto str = "test";
void testFunc ( )
in
{
switch (str)
{
case "test":
writeln("test"); // Does not generate a warning
default:
break;
}
}
body
{
switch (str)
{
case "test":
writeln("test"); // Generates a warning
default:
break;
}
}
testFunc();
}
-----