Open modulovalue opened 2 hours ago
Summary: The analyzer incorrectly fails to detect that a null-aware operator is unnecessary for an extension type (Foo
) when it should, as it does for a regular type (int
). This suggests a potential false negative in the analyzer's null-aware operator analysis for extension types.
Consider:
b?.toString();
causes the analyzer to emit aThe receiver can't be null, so the null-aware operator '?.' is unnecessary.
diagnostic, but it looks to me likea?.toString();
could also be annotated with a similar diagnostic.