False positive for prefer_self_in_static_references
when an inner struct has the same name as its owner
#5917
Labels
acceptable-false-positive
False positives caused by rules that are unavoidable due to missing type information.
bug
Unexpected and reproducible misbehavior.
New Issue Checklist
Bug Description
prefer_self_in_static_references
will report a violation atvar s = S1()
, but S1 here refers to the inner struct, not the outer one, sovar s= Self()
would be different, and would fail if the inner S1 has different properties to the outer one.As a workaround,
Has the same effect, but does not trigger
prefer_self_in_static_references
.The text was updated successfully, but these errors were encountered: