You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected Behavior:
The above code should be compiled correctly. Actual Behavior:
CS0019: The '??' operator cannot be apply between type T and <throw expression>
The text was updated successfully, but these errors were encountered:
While the C# language sepcification says comparison between an unrestricted genertic value and null is accepable, and it will returns true/false if the actual type is non-nullable. actually, the following code can pass the compilation check:
varx=(value!=null)?value:default(T);
So does it possible to enhance the compiler to accept nul-coalescing for unrestricted genertic value?
Version Used:
Visual Studio 2017
Steps to Reproduce:
The following code can reproduce the error:
Expected Behavior:
The above code should be compiled correctly.
Actual Behavior:
CS0019: The '??' operator cannot be apply between type
T
and<throw expression>
The text was updated successfully, but these errors were encountered: