@@ -22634,6 +22658,8 @@ public void UnboundLambda_02()
static void F(object? x)
{
var z = y => y ?? x.ToString();
System.Func<object?, object> z2 = y => y ?? x.ToString();
System.Func<object?, object> z3 = y => null;
}
}";
var comp = CreateCompilation(new[] { source }, options: WithNonNullTypesTrue());
...
...
@@ -22643,7 +22669,13 @@ static void F(object? x)
Diagnostic(ErrorCode.ERR_ImplicitlyTypedVariableAssignedBadValue, "z = y => y ?? x.ToString()").WithArguments("lambda expression").WithLocation(5, 13),
// (5,27): warning CS8602: Possible dereference of a null reference.