Conversation
When a Compose-compiler-generated class like `ComposableSingletons$MainActivityKt`
is inlined through an R8 synthetic lambda, the outer Kotlin class has no
top-level declaration in the mapping (only its `$$ExternalSyntheticLambda*`
children). The synthesizer previously took `split('$').next()`, collapsing
`ComposableSingletons$MainActivityKt` to `ComposableSingletons` and producing
`ComposableSingletons.java`.
Scan all `$`-separated segments for a Kotlin file-class marker (ends in `Kt`)
so the inner `MainActivityKt` segment wins and the file resolves to
`MainActivity.kt`. Bare top-level `FooKt` and non-Kotlin inner classes are
unaffected.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ader Merge the restored "Kt suffix takes precedence" note back into the scan-loop comment, and rename the test block header from `ComposableSingletonsInlinedLambdaStackTrace` to a plain description — the sibling blocks in this file name upstream R8 retrace fixtures, which this case is not. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
c3d15a4 to
4dcda1d
Compare
Dav1dde
approved these changes
Apr 23, 2026
loewenheim
requested changes
Apr 23, 2026
Replace the prose `For example:` list in the doc comment with actual unit tests covering the full matrix — top-level Kt, Kt-over-reference-file, reference-file extension, non-Kotlin inner class, ComposableSingletons wrapper, degenerate bare `Kt` segment, default `.java` fallback. Also convert the block `// ====` header on COMPOSABLE_SINGLETONS_INLINED_LAMBDA_MAPPING into a `///` doc comment on the constant, per review feedback. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
loewenheim
approved these changes
Apr 23, 2026
romtsn
added a commit
to getsentry/symbolicator
that referenced
this pull request
Apr 23, 2026
Bumps `proguard` from 5.10.2 to 5.10.3 to pick up the `ComposableSingletons$FileKt` source-file synthesis fix from [getsentry/rust-proguard#94](getsentry/rust-proguard#94). When a Compose-generated `ComposableSingletons$MainActivityKt` class is inlined through an R8 synthetic lambda and no top-level class declaration exists for it in the mapping (common in Android builds), the previous `synthesize_source_file` truncated at the first `$` and produced `ComposableSingletons.java`. 5.10.3 scans every `$`-segment for a `Kt` marker and now resolves to `MainActivity.kt`. No symbolicator-side changes are needed — the fix is entirely inside the leaf utility. Upstream carries unit tests (7 cases in `src/utils.rs`) and an integration test (`tests/r8-source-file-edge-cases.rs::test_composable_singletons_inlined_lambda_stacktrace`). Skipping an end-to-end integration test here since there's no new data flow or wiring to exercise on this side; happy to add one if reviewers prefer. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Fix synthesized source filenames for Compose-compiler-generated
ComposableSingletons$FileKtclasses when they are inlined through R8 synthetic lambdas.When a Compose compilation emits a
ComposableSingletons$MainActivityKtclass, the mapping often does not include a top-level declaration for it — only its$$ExternalSyntheticLambda*siblings appear, each carryingsourceFile: R8$$SyntheticClass. In that case the outer Kotlin class has nosourceFilemetadata of its own, and frame resolution falls back tosynthesize_source_file, which previously didsplit('$').next()and collapsedComposableSingletons$MainActivityKttoComposableSingletons. The resulting frame's filename becameComposableSingletons.java, dropping the realMainActivity.kt.The fix scans every
$-separated segment of the last dotted component for a Kotlin file-class marker (ends inKt). The innerMainActivityKtsegment now wins and producesMainActivity.kt. Bare top-level Kotlin classes (FooKt) and non-Kotlin inner classes (Foo$Bar→Foo.java) are unchanged — they still resolve on the first iteration exactly as before.Includes a minimal reproducer in
tests/r8-source-file-edge-cases.rsmirroring the scenario: aComposableSingletons$MyScreenKtlambda inlined through an$$ExternalSyntheticLambdawhosesourceFileisR8$$SyntheticClass.