[Fact]
public void Test()
{
var source = @"
class Outer
{
void M1(dynamic? x1)
{
if (x1 == null) return;
Outer y = x1;
x1.ToString();
}
}
";
CreateCompilation(source, options: WithNonNullTypesTrue()).VerifyDiagnostics(
// (7,19): warning CS8600: Converting null literal or possible null value to non-nullable type.
// Outer y = x1;
Diagnostic(ErrorCode.WRN_ConvertingNullableToNonNullable, "x1").WithLocation(7, 19),
// (8,9): warning CS8602: Possible dereference of a null reference.
// x1.ToString();
Diagnostic(ErrorCode.WRN_NullReferenceReceiver, "x1").WithLocation(8, 9)
);
}