Skip to content

Open generics in null coalescing operator #339

@KathleenDollard

Description

@KathleenDollard

We are considering a change to the behavior and spec for operands to null coalescing operators. The relevant part of the spec is here and the effect would be allowing unconstrained types. Where we currently say:

If two operands are provided, both of the operands must be classified as values, and the first operand must be either a reference type or a nullable value type.

We would update the spec to say:

If two operands are provided, both of the operands must be classified as values, and the first operand must not be a non-nullable value type.

C# has this proposed here and I'd like us to tag along.

Can anyone see a backwards compatibility issue? This seems just goodness to me.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions