dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
19.03k stars 4.03k forks source link

Replace `ConversionsBase.IncludeNullability` with diagnostic bag #27124

Open cston opened 6 years ago

cston commented 6 years ago

Consider replacing ConversionsBase.IncludeNullability with an optional diagnostic bag for nullable warnings.

See https://github.com/dotnet/roslyn/pull/26356#issuecomment-391870677.

cston commented 6 years ago

cc @gafter

cston commented 6 years ago

We'll need to consider the implications on BestTypeInferrer and MethodTypeInferrer which also use ConversionsBase.IncludeNullability.

gafter commented 6 years ago

Also, it would probably have to be something like a DiagnosticInfoBag because Conversions doesn't traffic in nodes or locations.

gafter commented 5 years ago

A preferred solution (from https://github.com/dotnet/roslyn/issues/30807) might be to remove nullability from ConversionsBase if possible, and consider nullability in conversions in NullableWalker only.