Skip to content

Conversation

@Zverik
Copy link
Collaborator

@Zverik Zverik commented Dec 31, 2025

I often encounter this when bridging abstract classes, which are both widely used (and make sense to be wrapped), and are meant to be subclassed. The common example of this is StatelessWidget in flutter_eval, which is also wrapped twice.

@ethanblake4
Copy link
Owner

I am pretty sure that the compiler does not actually support using both a bridge and a wrapper in the same program, so generating both of them won't do much. I could be wrong though, did you happen to test it?

@Zverik
Copy link
Collaborator Author

Zverik commented Dec 31, 2025

Right, I was not paying attention to StatelessWidget, that it doesn't declare anything and is used just to wrap classes. I have rewrote the method to add a light-weight wrapper then. Please take another look.

Also, I did test adding a same declaration twice to a compiler, and weirdly it worked :)

@ethanblake4
Copy link
Owner

Ah, I suppose this is a reasonable thing to add. So the wrapper is not being directly used by the compiler but is just for end-user usage. Yeah, in that case the compiler won't even be directly aware of it, but because it shares the same type spec as the bridge version it shouldn't complain...

@Zverik Zverik merged commit 9f6497a into master Jan 3, 2026
1 check passed
@Zverik Zverik deleted the bind_bridge_and_wrap branch January 3, 2026 20:43
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.

3 participants