Skip to content

Feat: Let a library resolve member names on Kotlin proxies - #29

Merged
b-re-w merged 1 commit into
developfrom
work/member-resolver
Oct 2, 2026
Merged

b-re-w merged 1 commit into
developfrom
work/member-resolver

Conversation

@b-re-w

@b-re-w b-re-w commented Oct 2, 2026

Copy link
Copy Markdown
Member

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.

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().
@b-re-w
b-re-w merged commit ba4c6f4 into develop Oct 2, 2026
@b-re-w
b-re-w deleted the work/member-resolver branch October 2, 2026 22:15
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.

1 participant