Open KrisVandermotten opened 3 years ago
@333fred @mavasani Do you know which symbols can never have nullability information?
It looks this applies to all member symbols (IFieldSymbol
, IEventSymbol
, IMethodSymbol
, IParameterSymbol
, etc.). This narrows down the potential false positives to:
Tagging @Evangelink
Comparing instances of
ITypeSymbol
using theirIEquatable<ISymbol>
interface could be a bug, because of NRT. RS1024 was introduced to discover those possible bugs early, and force the author to be explicit about the symbol equality comparer to be used. Obviously, the rule should apply when comparingITypeSymbol
instances, but also when comparingISymbol
instances, since those just might beITypeSymbol
instances.However, the rule should not apply to types implementing
IEquatable<ISymbol>
that do not inherit fromITypeSymbol
. Examples includeIAssemblySymbol
,IParameterSymbol
and others.Steps To Reproduce
Consider this code:
Expected behavior
No diagnostic is reported, since there is no ambiguity in comparing
IAssemblySymbol
instances.Actual behavior