Bug 20343 – false positive in style checker, checking casts
Status
RESOLVED
Resolution
INVALID
Severity
minor
Priority
P1
Component
tools
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2019-10-31T21:43:30Z
Last change time
2020-04-09T09:05:38Z
Assigned to
No Owner
Creator
berni44
Comments
Comment #0 by bugzilla — 2019-10-31T21:43:30Z
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.
Comment #1 by greeenify — 2019-10-31T23:23:06Z
Sorry to hear this, but this issue should be moved to the Dscanner repository. BTW for a spurious detection, you can selective disable a test for a module via the .dscanner.ini file in phobos.
Comment #2 by bugzilla — 2019-11-07T10:24:50Z
Sorry, moved back. According to the discussion in the Dscanner repository [1], it's not related to Dscanner but just a wrong grep.
[1] https://github.com/dlang-community/D-Scanner/issues/781
But maybe, "tools" is the wrong component and it should be "phobos"?
Comment #3 by pro.mathias.lang — 2020-04-09T09:05:38Z