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

Make generated Widget subinterfaces into abstract classes #2231

Open
JakeWharton opened this issue Aug 2, 2024 · 2 comments
Open

Make generated Widget subinterfaces into abstract classes #2231

JakeWharton opened this issue Aug 2, 2024 · 2 comments

Comments

@JakeWharton
Copy link
Collaborator

We want to generate behavior into them. This will also eliminate the annoying override var modifier: Modifier = Modifier boilerplate that every implementation has to do.

@JakeWharton
Copy link
Collaborator Author

This will allow generating a nice toString() automatically which will be useful for leak detection

@JakeWharton
Copy link
Collaborator Author

This doesn't actually solve our problems. Swift lacks abstract classes.

We may have to generate two types instead. A Widget and a Binding. You implement the Binding which is a pure delegate (maybe as a stateless thing), and then Widget wraps an instance + state (like modifier, tree walking) + stateless binding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants