Version Used: 16.5.0 Preview 2.0 [29614.18.master]
Steps to Reproduce:
#nullable enable
struct S
{
public static S operator |(S s, int _) => s;
}
class Program
{
void M()
{
S? s = null;
s ??= new S();
s.ToString(); // No warning
s |= 321; // CS8620
}
}
Argument of type 'S?' cannot be used for parameter 's' of type 'S' in 'S S.operator |(S s, int _)' due to differences in the nullability of reference types.
Expected Behavior:
No warning.
Actual Behavior:
Warning.
The problem does not exist if you use the longer form: