C#: Simplify the output of cs/wrong-compareto-signature to remove entity locations

This commit is contained in:
Tamas Vajk
2024-03-21 09:44:12 +01:00
parent daee22d38c
commit 9da8cb1165
2 changed files with 4 additions and 5 deletions

View File

@@ -40,6 +40,5 @@ where
compareToMethod(m, actualParamType) and
not implementsIComparable(declaringType, actualParamType)
select m,
"The parameter of this 'CompareTo' method is of type $@, but $@ does not implement 'IComparable<$@>'.",
actualParamType, actualParamType.getName(), declaringType, declaringType.getName(),
actualParamType, actualParamType.getName()
"The parameter of this 'CompareTo' method is of type '" + actualParamType.getName() +
"', but the declaring type does not implement 'IComparable<" + actualParamType.getName() + ">'."

View File

@@ -1,2 +1,2 @@
| IncorrectCompareToSignature.cs:5:16:5:24 | CompareTo | The parameter of this 'CompareTo' method is of type $@, but $@ does not implement 'IComparable<$@>'. | IncorrectCompareToSignature.cs:3:10:3:10 | T | T | IncorrectCompareToSignature.cs:3:7:3:11 | C1`1 | C1`1 | IncorrectCompareToSignature.cs:3:10:3:10 | T | T |
| IncorrectCompareToSignatureBad.cs:5:16:5:24 | CompareTo | The parameter of this 'CompareTo' method is of type $@, but $@ does not implement 'IComparable<$@>'. | IncorrectCompareToSignatureBad.cs:3:7:3:9 | Bad | Bad | IncorrectCompareToSignatureBad.cs:3:7:3:9 | Bad | Bad | IncorrectCompareToSignatureBad.cs:3:7:3:9 | Bad | Bad |
| IncorrectCompareToSignature.cs:5:16:5:24 | CompareTo | The parameter of this 'CompareTo' method is of type 'T', but the declaring type does not implement 'IComparable<T>'. |
| IncorrectCompareToSignatureBad.cs:5:16:5:24 | CompareTo | The parameter of this 'CompareTo' method is of type 'Bad', but the declaring type does not implement 'IComparable<Bad>'. |