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

Better support for complex inheritance #229

Merged
merged 4 commits into from
Aug 28, 2023

Conversation

asm0dey
Copy link
Contributor

@asm0dey asm0dey commented Aug 24, 2023

The current implementation had several issues:

  1. If there are classes A -> B -> C, C will be sealed, A and B will be data. This is incorrect, B should be open.
  2. All properties in B and C should be open: descendants can override them
  3. If class has no own properties, there can be two cases:
    3.1. It's a leaf (like A), then it should be data object, not just object
    3.2. It's a node (like B), then it should be open class

This commit addresses all these cases.

There is still one important issue I don't immediately know how to fix: all descendants should have an override modifier on fields, overriding fields in the whole tree.

asm0dey and others added 4 commits August 24, 2023 22:16
The current implementation had several issues:
1. If there are classes `A` -> `B` -> `C`, `C` will be `sealed`, `A` and `B` will be `data`. This is incorrect, `B` should be `open`.
2. All properties in `B` and `C` should be open: descendants can override them
3. If class has no own properties, there can be two cases:
    3.1. It's a leaf (like `A`), then it should be `data object`, not just object
    3.2. It's a node (like `B`), then it should be `open class`

This commit addresses all these cases.

There is still one important issue I don't immediately know how to fix: all descendants should have an `override` modifier on fields, overriding fields in the whole tree.
@inponomarev inponomarev merged commit 101eb4a into CourseOrchestra:master Aug 28, 2023
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.

2 participants