Skip to content

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
@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

3 participants