Nullability annotations are wrong
tom-englert opened this issue · 2 comments
tom-englert commented
Both TestCode
and FixedCode
properties accept null, but are marked as not-null
sharwell commented
Why would a user need to assign null
here? Seems like we would instead keep the current annotations, and over time if/when a user is assigning null and enables nullable reference types, they would be discouraged from that practice.
tom-englert commented
Just to be able to continue using this when nullable is enabled:
public class AnalyzerTest<TAnalyzer> : CSharpAnalyzerTest<TAnalyzer, Verifier>
where TAnalyzer : DiagnosticAnalyzer, new()
{
public AnalyzerTest(string? source = null)
{
TestCode = source;
ReferenceAssemblies = ReferenceAssemblies.Net.Net60;
}
}