[Issue 16967] New: No switch case fallthrough warnings in in/out contracts

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Dec 12 07:41:34 PST 2016


https://issues.dlang.org/show_bug.cgi?id=16967

          Issue ID: 16967
           Summary: No switch case fallthrough warnings in in/out
                    contracts
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: benpnz at gmail.com

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();
}
-----

--


More information about the Digitalmars-d-bugs mailing list