Skip to content

Binder: object @Composable members and foundation.shape (#307) - #314

Merged
b-re-w merged 2 commits into
developfrom
feat/binder-shape-colors
Oct 25, 2026
Merged

b-re-w merged 2 commits into
developfrom
feat/binder-shape-colors

Conversation

@b-re-w

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

Copy link
Copy Markdown
Member

Closes #307

  • The walker no longer declines a @composable member of a Kotlin object. Its thunk loads Owner.INSTANCE (GETSTATIC) and calls the member with INVOKEVIRTUAL, using the walked MethodNode's own name and descriptor, so there is no name lookup (rule 12.4). Value-returning composables already crossed as OBJECT. No public API change: ThunkSpec.onObjectInstance is internal.
  • The compose and notebook-e2e fixtures walk androidx.compose.foundation.shape.
  • SPEC B-1 and the notebook-e2e README gap rows are updated.
  • Tests:
    • ComposableBindingTest: an object composable binds through an instance thunk, and the thunk is run against an ASM probe.
    • ShapeAndColorsRenderTest: Button and Card with RoundedCornerShape__Dp(20) and red buttonColors/cardColors. The checks are the centre pixel, and the corner of the square control's painted box: red at radius 0, unpainted at 20.
    • ComposableValueClassSlotTest now selects top-level Icon by FQN, because SegmentedButtonDefaults.Icon now binds and has no tint.
  • Red check: with the decline put back, the ComposableBindingTest case and both render tests fail.
  • Results:

…s); walk foundation.shape (#307)

The walker declined an object's composable member because its thunk was a static call. The thunk
now loads the object's INSTANCE and calls the member with INVOKEVIRTUAL, using the walked
MethodNode's own name and descriptor (no name lookup); value-returning composables already crossed
as OBJECT handles. The compose and notebook-e2e fixtures walk androidx.compose.foundation.shape, so
Button/Card take shape=RoundedCornerShape__Dp(..) and colors=ButtonDefaults.buttonColors(..) /
CardDefaults.cardColors(..). ComposableValueClassSlotTest now selects the top-level Icon overloads
by FQN, since SegmentedButtonDefaults.Icon binds too.
…colors

# Conflicts:
#	python-multiplatform-compose/fixtures/notebook-e2e/README.md
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