csharpstandard icon indicating copy to clipboard operation
csharpstandard copied to clipboard

Nullable Spec Issue List

Open gafter opened this issue 6 years ago • 2 comments

These are things that should be spelled out in the nullable reference types feature specification:

  • [ ] The handling of a lifted operator (if a comparison operator, the return type is still bool, but other operators have value types turned into Nullable of that value type, and reference types are made nullable. If either operand might be null, then the result might be null if the resulting return type is capable containing null.

  • [ ] In order to preserve the safety in the face of unconstrained type parameters, we warn immediately when a null value of such a type is introduced. This is a safety warning. The contexts in which such a warning are given are

  • default and default(T)

  • null conversion to T (when T is known to be ref type)

  • e?.M() when the return type is T

  • dynamic conversion or cast to T when the dynamic might be null

  • explicit conversion to T

  • e as T when there is not an implicit conversion from the type of e to T

  • a call to a method like FirstOrDefault() that is annotated with `[MaybeNull] (not yet implemented)

gafter avatar Feb 27 '19 23:02 gafter