Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplication on null conversion #1156

Open
BillWagner opened this issue Aug 12, 2024 · 2 comments
Open

Duplication on null conversion #1156

BillWagner opened this issue Aug 12, 2024 · 2 comments

Comments

@BillWagner
Copy link
Member

We repeat ourselves, and classify an expression such as object o = null in two different ways:

10.2.7 Null literal conversions

An implicit conversion exists from the null literal to any reference type or nullable value type.

10.2.8 Implicit reference conversions includes:

  • From the null literal (§6.4.5.7) to any reference-type.

We should classify it as one or the other.

@BillWagner
Copy link
Member Author

/cc @jcouv

@Nigel-Ecma
Copy link
Contributor

This is a leftover over from wiping the null type. Back in v1 §9.4.4.6 defined the null-literal to have the null type, and §13.1.4 (now §10.2.8) said “From the null type to any reference-type”. So no double naming.

I expect the term “null literal conversion” is too well used now to be dropped, and also that the conversion should be mentioned along with other implicit reference conversions.

We could alternatively view null literal conversions as a subset of implicit reference conversions. Maybe start §10.2.8:

The implicit reference conversions include the null literal conversion (§10.2.7) and the following:

or better wordsmithing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants