Skip to content

Commit c3d15a4

Browse files
romtsnclaude
andcommitted
ref: Combine Kt-marker rationale into one comment, drop R8 fixture header
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>
1 parent c1e0d61 commit c3d15a4

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/utils.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ pub(crate) fn synthesize_source_file(
2222
let mut segments = last_segment.split('$');
2323
let base = segments.next()?;
2424

25-
// Compiler-generated wrappers (e.g. `ComposableSingletons$MainActivityKt`)
26-
// bury the `Kt` marker in an inner segment, so checking only `base` misses them.
25+
// Kt suffix is a strong Kotlin indicator and takes precedence over reference_file.
26+
// Compiler-generated wrappers (e.g. `ComposableSingletons$MainActivityKt`) bury the
27+
// marker in an inner segment, so we scan every `$`-segment, not just `base`.
2728
for segment in std::iter::once(base).chain(segments) {
2829
if let Some(kotlin_base) = segment.strip_suffix("Kt").filter(|s| !s.is_empty()) {
2930
return Some(format!("{}.kt", kotlin_base));

tests/r8-source-file-edge-cases.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ fn test_source_file_name_synthesize_stacktrace() {
118118
}
119119

120120
// =============================================================================
121-
// ComposableSingletonsInlinedLambdaStackTrace
121+
// ComposableSingletons inlined lambda
122122
//
123123
// When a lambda from a Compose `ComposableSingletons$FileKt` wrapper is inlined
124124
// through an R8 synthetic class, the outer class has no `sourceFile` metadata of

0 commit comments

Comments
 (0)