Skip to content

Draft grammar to permit nullable types as array element types. #1297

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

Draft
wants to merge 4 commits into
base: draft-v8
Choose a base branch
from

Conversation

gafter
Copy link
Member

@gafter gafter commented Mar 19, 2025

Proposed replacement for #1287

@Nigel-Ecma Can you please help me set up the testing for this PR?

@gafter gafter marked this pull request as draft March 19, 2025 22:28
@gafter gafter requested a review from Nigel-Ecma March 19, 2025 22:58
@gafter gafter added the meeting: discuss This issue should be discussed at the next TC49-TG2 meeting label Mar 19, 2025
@@ -54,7 +54,8 @@ interface_type
;

array_type
: non_array_type rank_specifier+
| non_array_type rank_specifier+
| non_array_type ( nullable_type_annotation rank_specifier+ )+
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this allow int??[]?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, because a nullable type isn't a non_array_type.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm reading it right, non_array_type includes value_type which includes nullable_value_type which I believe int? would be.

@gafter gafter marked this pull request as ready for review March 20, 2025 20:32
Copy link
Contributor

@Nigel-Ecma Nigel-Ecma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See TG2 email discussion for details.

@Nigel-Ecma Nigel-Ecma marked this pull request as draft April 14, 2025 05:58
@jskeet
Copy link
Contributor

jskeet commented Jun 11, 2025

We want to wait for a meeting where @gafter is present to discuss this as well, but @jnm2 is keen to get his hands dirty with it when he finds time.

Copy link
Contributor

@jnm2 jnm2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want to wait for a meeting where @gafter is present to discuss this as well, but @jnm2 is keen to get his hands dirty with it when he finds time.

I made it happen! See #1386 for my proposed grammar changes. If we take my PR as the direction, @gafter's other changes in this PR will be valuable to move over.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meeting: discuss This issue should be discussed at the next TC49-TG2 meeting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy