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

Added sealed type support #308

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

brokenhappy
Copy link

#305

  • Added inspections for sealed rules
  • Updated default Java version to 17

wout.werkman added 2 commits November 25, 2022 18:32
 - Added sealed support to BnfDiagram
 - Added inspections for sealed rules
 - Updated default Java version to 17
@brokenhappy
Copy link
Author

brokenhappy commented Nov 25, 2022

The concept of having rules with interface but without implementations are new to the PSI structure. There are many concepts that rely on this, such as mixin, extends, elementType etc.

So far the behavior presented here pretty much ignores all of them but methods. methods is forwarded down the sealed hierarchy, and all leaves (non-sealed) implement all methods from all of their sealed super-rules.
This is not consistent with extends or mixin etc.

Also, if someone accidentally extends a sealed type, the sealed type semantics are dropped. (there's an inspection for this, see org.intellij.grammar.BnfSealedRuleInspectionsTest#testSealedRulesMayNotBeExtendedTo)

Any thoughts on this, and are there any assumptions that are broken by this approach?

wout.werkman added 3 commits November 26, 2022 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant