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

Fixes for deep and declared hierarchies #973

Merged

Conversation

daumantas-kavolis-sensmetry
Copy link
Contributor

@daumantas-kavolis-sensmetry daumantas-kavolis-sensmetry commented Mar 2, 2023

Fixes #949:

  • $type missing some subtype names occasionally - names are collected recursively
  • assignment validation using inferred hierarchy which is very likely to be incomplete - replaced the inferred property type with a matching declared type for assignment checks only. Also tested on https://gitlab.com/sensmetry/public/sysml-2ls

This does not fix $container being non-optional on grammar entry types and its supertypes.

@msujew msujew added the types Types related issue label Mar 3, 2023
Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

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

Thanks, that's very helpful! I have a few improvements on the testing code, but otherwise this looks already pretty good 👍

@daumantas-kavolis-sensmetry
Copy link
Contributor Author

I have split the $type tests into smaller ones but only the last one failed without the fix, and removed as much as possible from the assignment test such that it failed without a fix.

@daumantas-kavolis-sensmetry
Copy link
Contributor Author

Wait, the $type test doesn't fail on main, I'll look into it.

@daumantas-kavolis-sensmetry
Copy link
Contributor Author

Had to use the previous test case to make the test fail. With some branch types removed the test would pass on main so I did not simplify it.

Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍

@msujew msujew merged commit 18fa548 into eclipse-langium:main Mar 6, 2023
@daumantas-kavolis-sensmetry daumantas-kavolis-sensmetry deleted the fix/type-hierarchy branch March 6, 2023 10:59
@msujew msujew added this to the v1.2.0 milestone Mar 27, 2023
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.

Type inference issues
2 participants