eclipse-langium / langium

Next-gen language engineering / DSL framework
https://langium.org/
MIT License
663 stars 61 forks source link

Merge inferred array types #1506

Closed msujew closed 4 weeks ago

msujew commented 1 month ago

Closes https://github.com/eclipse-langium/langium/issues/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 https://github.com/eclipse-langium/langium-website/pull/132#issuecomment-2117565838.