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: [email protected]
          Reporter: [email protected]

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.

--

Reply via email to