public Foo(T bar)
{
if (bar == null) // Use 'Throw' expression here...
{
throw new ArgumentNullException(nameof(bar));
}
}
Error CS0019 Operator '??' cannot be applied to operands of type 'T' and '\'
However, if I add a constraint on T in my class it works:
public sealed class Foo<TClass> where TClass : class
{}
Expected Behavior:
The "Use Throw expression" command should not be available or it should complain about the type. Maybe suggest adding the "where"-constraint above?
Version Used: 15.2 (26430.4)
Steps to Reproduce:
Error CS0019 Operator '??' cannot be applied to operands of type 'T' and '\'
However, if I add a constraint on T in my class it works:
Expected Behavior: The "Use Throw expression" command should not be available or it should complain about the type. Maybe suggest adding the "where"-constraint above?
Actual Behavior: Compilation error CS0019.