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

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

Open
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
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.

2 participants