Skip to content

Nullable Spec Issue List #1228

@gafter

Description

@gafter

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions