-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Open
Labels
3 - WorkingArea-CompilersBugFeature - Nullable Reference TypesNullable Reference TypesNullable Reference Types
Milestone
Description
There are a number of cases in NullableWalker
where methods from initial binding should be updated based on the inferred nullability.
For instance, both calls to .ToString()
below should report warnings but no warning is reported for the second case currently.
#nullable enable
class C<T>
{
internal T F() => throw null;
}
class Program
{
static C<T> Create<T>(T t)
{
return new C<T>();
}
static void F(string? s)
{
new C<string?>().F().ToString(); // warning: maybe null
Create(s).F().ToString(); // no warning
}
}
Test cases affected: NullableReferenceTypesTests.ImplicitConversions_07
[jcouv update:] both calls to .ToString()
now report warnings (sharplab) but more references to this issue remain in the source.
Metadata
Metadata
Assignees
Labels
3 - WorkingArea-CompilersBugFeature - Nullable Reference TypesNullable Reference TypesNullable Reference Types