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

Merge inferred array types #1506

Merged
merged 2 commits into from
Jun 5, 2024
Merged

Merge inferred array types #1506

merged 2 commits into from
Jun 5, 2024

Conversation

msujew
Copy link
Member

@msujew msujew commented May 21, 2024

Closes #1505

Note that this approach has a very minor issue in regards to alternatives of lists:

A: (values+=ID* | values+=NUMBER*);

The expected type would be values: Array<string> | Array<number>, but this PR adjusts this to generate values: Array<string | number>. I think this is "good enough" as it fixes the much more common issue of values+=ID values+=NUMBER. See also eclipse-langium/langium-website#132 (comment).

Copy link
Contributor

@Lotes Lotes left a comment

Choose a reason for hiding this comment

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

Thanks for the change :-). Two remarks about code duplication and immutable operations.

@msujew msujew requested a review from Lotes June 5, 2024 11:58
Copy link
Contributor

@Lotes Lotes left a comment

Choose a reason for hiding this comment

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

LGTM

@msujew msujew merged commit 1ed839a into main Jun 5, 2024
5 checks passed
@msujew msujew deleted the msujew/merge-array-types branch June 5, 2024 12:03
@msujew msujew added this to the v3.1.0 milestone Jun 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
types Types related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect array type inference
2 participants