-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
Area-CompilersBugFeature - Nullable Reference TypesNullable Reference TypesNullable Reference TypesResolution-FixedThe bug has been fixed and/or the requested behavior has been implementedThe bug has been fixed and/or the requested behavior has been implemented
Milestone
Description
Method type inference should report a warning that nullability could not be inferred:
using System;
using System.Runtime.CompilerServices;
[module: NonNullTypes]
interface I<T> { }
class C
{
static void F<T>(Func<bool, T> f)
{
}
static void G(I<object> x, I<object?> y)
{
F(b => { if (b) return x; else return y; }); // warning: cannot infer nullability
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Area-CompilersBugFeature - Nullable Reference TypesNullable Reference TypesNullable Reference TypesResolution-FixedThe bug has been fixed and/or the requested behavior has been implementedThe bug has been fixed and/or the requested behavior has been implemented