[Issue 20343] New: false positive in style checker, checking casts

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Oct 31 21:43:30 UTC 2019


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

          Issue ID: 20343
           Summary: false positive in style checker, checking casts
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P1
         Component: tools
          Assignee: nobody at puremagic.com
          Reporter: bugzilla at d-ecke.de

The following unittest (in std.format) was rejected by the style checker:

@safe pure unittest
{
    enum A { one, two, three }

    string t2 = format("[%10s] [%-10s]", cast(A) 10, cast(A) 10);
    assert(t2 == "[ cast(A)10] [cast(A)10 ]");
}

The problem is the cast(A)10 inside the string.

--


More information about the Digitalmars-d-bugs mailing list