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

Request: Provide AnyLuaControlBehavior and other Any for classes with parents, where appropriate #140

Open
sparr opened this issue Sep 15, 2024 · 0 comments

Comments

@sparr
Copy link
Contributor

sparr commented Sep 15, 2024

Most(?) fields and method returns typed as LuaControlBehavior can return any of the child classes, such as LuaConstantCombinatorControlBehavior. Those types should be LuaControlBehavior | LuaConstantCombinatorControlBehavior | etc instead. The relationship between the two types is apparent in the runtime json, as one is the parent of the other.

Based on other examples in the source, this might be implemented as a new alias named AnyLuaControlBehavior. I expect such a change would also apply to some other types with parents, and I thought I had seen a couple while investigating this, but I'm failing to find them right now.

I'd like to work on implementing this, but am posting here first to make sure it's a good/welcome idea, and also to ask for guidance on implementation. Since the two classes are defined in different places (unlike the subclasses handled in #138) it is not clear to me where/how to best approach aggregating the list of child classes of a parent, or where to put the final alias.

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

No branches or pull requests

1 participant