You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, this won't work for generic collections for which the typeSymbol.SpecialType contains the concrete type - e.g. List<string>, whereas the generic type definition is List<T>.
To fix this, the OriginalDefinition.SpecialType should be compared as well, like below.
The text was updated successfully, but these errors were encountered:
andrei-epure-sonarsource
changed the title
TypeHelper.IsMatch should check OriginalDefinition as well
TypeHelper.IsMatch should check OriginalDefinition as well to work with generics
Nov 29, 2018
@andrei-epure-sonarsource The current approach that was taken, was to say that when calling this method, if you can have generics, then you should ensure the OriginalDefinition is passed.
TypeHelper.IsMatch checks only the typeSymbol.
However, this won't work for generic collections for which the
typeSymbol.SpecialType
contains the concrete type - e.g.List<string>
, whereas the generic type definition isList<T>
.To fix this, the
OriginalDefinition.SpecialType
should be compared as well, like below.The text was updated successfully, but these errors were encountered: