Repository navigation
Feat: Let a library resolve member names on Kotlin proxies - #29
Merged
Merged
Conversation
python_multiplatform.binding.add_member_resolver(fn) is asked only when a proxy has no Kotlin member of the requested name; fn returns the Kotlin member to serve, or None. The binder still renames nothing: with no resolver the surface is Kotlin names only, and resolved aliases are cached in the resolver registry, never written onto proxy classes, so dir() and the class dict stay Kotlin. This is the hook pythonx-compose needs for chains like Modifier.padding(16).fill_max_width().
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #17
Contract in KotlinSurface.kt KDoc and SPEC U-9. Tests: MemberResolverTest (6, red 5/6 before), MemberResolverComposeTest (real Compose chain, equality with Modifier.padding(16.dp).fillMaxWidth()). Tamper check: disabling _resolve_member fails both.
Verification: desktopTest 540/0, compose fixtures 102/0 (one timing-count test flaked once at load 45 and passed twice on rerun), app 70/0, artifact 33/0, androidNative compile OK.