Skip to content

Commit c97d41b

Browse files
ShikaSDSpace Cloud
authored and
Space Cloud
committed
Emit parameter names in Compose source information
Required to support indy-desugared lambda parameters in Layout inspector. Bug: 408492167 Test: Updated compiler tests
1 parent db3f3d5 commit c97d41b

File tree

341 files changed

+667
-499
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

341 files changed

+667
-499
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright 2010-2025 JetBrains s.r.o. and Kotlin Programming Language contributors.
3+
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
4+
*/
5+
6+
package androidx.compose.compiler.plugins.kotlin
7+
8+
import org.jetbrains.kotlin.config.CompilerConfiguration
9+
import org.jetbrains.kotlin.config.JVMConfigurationKeys
10+
import org.jetbrains.kotlin.config.JvmClosureGenerationScheme
11+
import org.junit.runner.RunWith
12+
import org.junit.runners.JUnit4
13+
import kotlin.test.Test
14+
15+
@RunWith(JUnit4::class)
16+
class ComposeLambdaClassCodegenTest : AbstractIrTransformTest(useFir = true) {
17+
override fun CompilerConfiguration.updateConfiguration() {
18+
put(JVMConfigurationKeys.LAMBDAS, JvmClosureGenerationScheme.CLASS)
19+
put(ComposeConfiguration.SOURCE_INFORMATION_ENABLED_KEY, true)
20+
}
21+
22+
@Test
23+
fun testLambdaClassParameterInfo() = verifyGoldenComposeIrTransform(
24+
"""
25+
import androidx.compose.runtime.Composable
26+
27+
@Composable
28+
fun Test(z: Int, x: Int, y: Result<Int>) {
29+
Wrapper { Test(z, x, y) }
30+
}
31+
32+
@Composable
33+
fun Wrapper(content: @Composable () -> Unit) { content() }
34+
"""
35+
)
36+
}

plugins/compose/compiler-hosted/integration-tests/src/jvmTest/resources/golden/androidx.compose.compiler.plugins.kotlin.ClassStabilityTransformTests/testComposableCallWithUnstableFinalClassInSameModule[useFir = true].txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class Foo(var bar: Int = 0) {
2424
@Composable
2525
fun A(y: Int, x: Foo, %composer: Composer?, %changed: Int) {
2626
%composer = %composer.startRestartGroup(<>)
27-
sourceInformation(%composer, "C(A)P(1)<B(x)>:Test.kt")
27+
sourceInformation(%composer, "C(A)N(y,x)<B(x)>:Test.kt")
2828
val %dirty = %changed
2929
if (%changed and 0b0110 == 0) {
3030
%dirty = %dirty or if (%composer.changed(y)) 0b0100 else 0b0010
@@ -51,7 +51,7 @@ fun A(y: Int, x: Foo, %composer: Composer?, %changed: Int) {
5151
@Composable
5252
fun B(x: Any, %composer: Composer?, %changed: Int) {
5353
%composer = %composer.startRestartGroup(<>)
54-
sourceInformation(%composer, "C(B):Test.kt")
54+
sourceInformation(%composer, "C(B)N(x):Test.kt")
5555
val %dirty = %changed
5656
if (%changed and 0b0110 == 0) {
5757
%dirty = %dirty or if (%composer.changedInstance(x)) 0b0100 else 0b0010

plugins/compose/compiler-hosted/integration-tests/src/jvmTest/resources/golden/androidx.compose.compiler.plugins.kotlin.ClassStabilityTransformTests/testComposableCall[useFir = true].txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class Foo {
2424
@Composable
2525
fun A(y: Int, x: Any, %composer: Composer?, %changed: Int) {
2626
%composer = %composer.startRestartGroup(<>)
27-
sourceInformation(%composer, "C(A)P(1)<B(x)>:Test.kt")
27+
sourceInformation(%composer, "C(A)N(y,x)<B(x)>:Test.kt")
2828
val %dirty = %changed
2929
if (%changed and 0b0110 == 0) {
3030
%dirty = %dirty or if (%composer.changed(y)) 0b0100 else 0b0010
@@ -51,7 +51,7 @@ fun A(y: Int, x: Any, %composer: Composer?, %changed: Int) {
5151
@Composable
5252
fun B(x: Any, %composer: Composer?, %changed: Int) {
5353
%composer = %composer.startRestartGroup(<>)
54-
sourceInformation(%composer, "C(B):Test.kt")
54+
sourceInformation(%composer, "C(B)N(x):Test.kt")
5555
val %dirty = %changed
5656
if (%changed and 0b0110 == 0) {
5757
%dirty = %dirty or if (%composer.changedInstance(x)) 0b0100 else 0b0010

plugins/compose/compiler-hosted/integration-tests/src/jvmTest/resources/golden/androidx.compose.compiler.plugins.kotlin.ClassStabilityTransformTests/testEmptyClassAcrossModules[useFir = true].txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import androidx.compose.runtime.Composable
1717
@Composable
1818
fun A(y: Any, %composer: Composer?, %changed: Int) {
1919
%composer = %composer.startRestartGroup(<>)
20-
sourceInformation(%composer, "C(A)<A(Wrap...>:Test.kt")
20+
sourceInformation(%composer, "C(A)N(y)<A(Wrap...>:Test.kt")
2121
val %dirty = %changed
2222
if (%changed and 0b0110 == 0) {
2323
%dirty = %dirty or if (%composer.changedInstance(y)) 0b0100 else 0b0010

plugins/compose/compiler-hosted/integration-tests/src/jvmTest/resources/golden/androidx.compose.compiler.plugins.kotlin.ClassStabilityTransformTests/testLocalParameterBasedTypeParameterSubstitution[useFir = true].txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import androidx.compose.runtime.Composable
2525
@Composable
2626
fun <V> B(value: V, %composer: Composer?, %changed: Int) {
2727
%composer = %composer.startRestartGroup(<>)
28-
sourceInformation(%composer, "C(B)<A(Wrap...>:Test.kt")
28+
sourceInformation(%composer, "C(B)N(value)<A(Wrap...>:Test.kt")
2929
val %dirty = %changed
3030
if (%changed and 0b0110 == 0) {
3131
%dirty = %dirty or if (if (%changed and 0b1000 == 0) {
@@ -54,7 +54,7 @@ fun <V> B(value: V, %composer: Composer?, %changed: Int) {
5454
@ComposableInferredTarget(scheme = "[0[0]]")
5555
fun <T> X(items: List<T>, itemContent: Function3<T, Composer, Int, Unit>, %composer: Composer?, %changed: Int) {
5656
%composer = %composer.startRestartGroup(<>)
57-
sourceInformation(%composer, "C(X)P(1)*<itemCo...>:Test.kt")
57+
sourceInformation(%composer, "C(X)N(items,itemContent)*<itemCo...>:Test.kt")
5858
val %dirty = %changed
5959
if (%changed and 0b0110 == 0) {
6060
%dirty = %dirty or if (%composer.changedInstance(items)) 0b0100 else 0b0010
@@ -84,7 +84,7 @@ fun <T> X(items: List<T>, itemContent: Function3<T, Composer, Int, Unit>, %compo
8484
@Composable
8585
fun C(items: List<String>, %composer: Composer?, %changed: Int) {
8686
%composer = %composer.startRestartGroup(<>)
87-
sourceInformation(%composer, "C(C)<X(item...>:Test.kt")
87+
sourceInformation(%composer, "C(C)N(items)<X(item...>:Test.kt")
8888
val %dirty = %changed
8989
if (%changed and 0b0110 == 0) {
9090
%dirty = %dirty or if (%composer.changedInstance(items)) 0b0100 else 0b0010
@@ -106,7 +106,7 @@ fun C(items: List<String>, %composer: Composer?, %changed: Int) {
106106
}
107107
internal object ComposableSingletons%TestKt {
108108
val lambda%1463567948: Function3<String, Composer, Int, Unit> = composableLambdaInstance(<>, false) { item: String, %composer: Composer?, %changed: Int ->
109-
sourceInformation(%composer, "C<A(item...>,<A(Wrap...>:Test.kt")
109+
sourceInformation(%composer, "invalid source info at 1: 'CN(item)12@440L7,13@468L16:Test.kt'")
110110
val %dirty = %changed
111111
if (%changed and 0b0110 == 0) {
112112
%dirty = %dirty or if (%composer.changed(item)) 0b0100 else 0b0010

plugins/compose/compiler-hosted/integration-tests/src/jvmTest/resources/golden/androidx.compose.compiler.plugins.kotlin.ClassStabilityTransformTests/testStabilityPropagationOfVariousTypesInSameModule[useFir = true].txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class UnstableDelegateProp {
5555
@Composable
5656
fun A(y: Any, %composer: Composer?, %changed: Int) {
5757
%composer = %composer.startRestartGroup(<>)
58-
sourceInformation(%composer, "C(A)<A(X(li...>,<A(Stab...>,<A(Unst...>,<A(Sing...>,<A(Sing...>,<A(Sing...>:Test.kt")
58+
sourceInformation(%composer, "C(A)N(y)<A(X(li...>,<A(Stab...>,<A(Unst...>,<A(Sing...>,<A(Sing...>,<A(Sing...>:Test.kt")
5959
val %dirty = %changed
6060
if (%changed and 0b0110 == 0) {
6161
%dirty = %dirty or if (%composer.changedInstance(y)) 0b0100 else 0b0010

plugins/compose/compiler-hosted/integration-tests/src/jvmTest/resources/golden/androidx.compose.compiler.plugins.kotlin.ClassStabilityTransformTests/testStabilityPropagationOfVariousTypes[useFir = true].txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import androidx.compose.runtime.Composable
3434
@Composable
3535
fun A(y: Any?, %composer: Composer?, %changed: Int, %default: Int) {
3636
%composer = %composer.startRestartGroup(<>)
37-
sourceInformation(%composer, "C(A)<A()>,<A(Empt...>,<A(Sing...>,<A(Sing...>,<A(Sing...>,<A(Sing...>,<A(Sing...>,<A(Sing...>,<A(Doub...>,<A(Doub...>,<A(Doub...>,<A(Doub...>,<A(X(li...>,<A(X(li...>,<A(NonB...>,<A(NonB...>,<A(Stab...>,<A(Unst...>:Test.kt")
37+
sourceInformation(%composer, "C(A)N(y)<A()>,<A(Empt...>,<A(Sing...>,<A(Sing...>,<A(Sing...>,<A(Sing...>,<A(Sing...>,<A(Sing...>,<A(Doub...>,<A(Doub...>,<A(Doub...>,<A(Doub...>,<A(X(li...>,<A(X(li...>,<A(NonB...>,<A(NonB...>,<A(Stab...>,<A(Unst...>:Test.kt")
3838
val %dirty = %changed
3939
if (%default and 0b0001 != 0) {
4040
%dirty = %dirty or 0b0110

plugins/compose/compiler-hosted/integration-tests/src/jvmTest/resources/golden/androidx.compose.compiler.plugins.kotlin.ClassStabilityTransformTests/testStabilityPropagationTooManyTypeParamsSameModule[useFir = true].txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ fun used(any: Any? = null) { }
9797
@Composable
9898
fun A(y: Any?, %composer: Composer?, %changed: Int, %default: Int) {
9999
%composer = %composer.startRestartGroup(<>)
100-
sourceInformation(%composer, "C(A)<A(>:Test.kt#2p")
100+
sourceInformation(%composer, "C(A)N(y)<A(>:Test.kt#2p")
101101
val %dirty = %changed
102102
if (%default and 0b0001 != 0) {
103103
%dirty = %dirty or 0b0110

plugins/compose/compiler-hosted/integration-tests/src/jvmTest/resources/golden/androidx.compose.compiler.plugins.kotlin.ClassStabilityTransformTests/testStabilityPropagationTooManyTypeParams[useFir = true].txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ import androidx.compose.runtime.Composable
5454
@Composable
5555
fun A(y: Any?, %composer: Composer?, %changed: Int, %default: Int) {
5656
%composer = %composer.startRestartGroup(<>)
57-
sourceInformation(%composer, "C(A)<A(>:Test.kt")
57+
sourceInformation(%composer, "C(A)N(y)<A(>:Test.kt")
5858
val %dirty = %changed
5959
if (%default and 0b0001 != 0) {
6060
%dirty = %dirty or 0b0110
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
//
2+
// Source
3+
// ------------------------------------------
4+
5+
import androidx.compose.runtime.Composable
6+
7+
@Composable
8+
fun Test(z: Int, x: Int, y: Result<Int>) {
9+
Wrapper { Test(z, x, y) }
10+
}
11+
12+
@Composable
13+
fun Wrapper(content: @Composable () -> Unit) { content() }
14+
15+
//
16+
// Transformed IR
17+
// ------------------------------------------
18+
19+
@Composable
20+
fun Test(z: Int, x: Int, y: Result<Int>, %composer: Composer?, %changed: Int) {
21+
%composer = %composer.startRestartGroup(<>)
22+
sourceInformation(%composer, "C(Test)P(2!,1:kotlin.Result)<{>,<Wrappe...>:Test.kt")
23+
val %dirty = %changed
24+
if (%changed and 0b0110 == 0) {
25+
%dirty = %dirty or if (%composer.changed(z)) 0b0100 else 0b0010
26+
}
27+
if (%changed and 0b00110000 == 0) {
28+
%dirty = %dirty or if (%composer.changed(x)) 0b00100000 else 0b00010000
29+
}
30+
if (%changed and 0b000110000000 == 0) {
31+
%dirty = %dirty or if (%composer.changedInstance(<unsafe-coerce>(y))) 0b000100000000 else 0b10000000
32+
}
33+
if (%composer.shouldExecute(%dirty and 0b10010011 != 0b10010010, %dirty and 0b0001)) {
34+
if (isTraceInProgress()) {
35+
traceEventStart(<>, %dirty, -1, <>)
36+
}
37+
Wrapper(rememberComposableLambda(<>, true, { %composer: Composer?, %changed: Int ->
38+
sourceInformation(%composer, "C<Test(z...>:Test.kt")
39+
if (%composer.shouldExecute(%changed and 0b0011 != 0b0010, %changed and 0b0001)) {
40+
if (isTraceInProgress()) {
41+
traceEventStart(<>, %changed, -1, <>)
42+
}
43+
Test(z, x, y, %composer, 0)
44+
if (isTraceInProgress()) {
45+
traceEventEnd()
46+
}
47+
} else {
48+
%composer.skipToGroupEnd()
49+
}
50+
}, %composer, 0b00110110), %composer, 0b0110)
51+
if (isTraceInProgress()) {
52+
traceEventEnd()
53+
}
54+
} else {
55+
%composer.skipToGroupEnd()
56+
}
57+
%composer.endRestartGroup()?.updateScope { %composer: Composer?, %force: Int ->
58+
Test(z, x, y, %composer, updateChangedFlags(%changed or 0b0001))
59+
}
60+
}
61+
@Composable
62+
@ComposableInferredTarget(scheme = "[0[0]]")
63+
fun Wrapper(content: Function2<Composer, Int, Unit>, %composer: Composer?, %changed: Int) {
64+
%composer = %composer.startRestartGroup(<>)
65+
sourceInformation(%composer, "C(Wrapper)<conten...>:Test.kt")
66+
val %dirty = %changed
67+
if (%changed and 0b0110 == 0) {
68+
%dirty = %dirty or if (%composer.changedInstance(content)) 0b0100 else 0b0010
69+
}
70+
if (%composer.shouldExecute(%dirty and 0b0011 != 0b0010, %dirty and 0b0001)) {
71+
if (isTraceInProgress()) {
72+
traceEventStart(<>, %dirty, -1, <>)
73+
}
74+
content(%composer, 0b1110 and %dirty)
75+
if (isTraceInProgress()) {
76+
traceEventEnd()
77+
}
78+
} else {
79+
%composer.skipToGroupEnd()
80+
}
81+
%composer.endRestartGroup()?.updateScope { %composer: Composer?, %force: Int ->
82+
Wrapper(content, %composer, updateChangedFlags(%changed or 0b0001))
83+
}
84+
}

plugins/compose/compiler-hosted/integration-tests/src/jvmTest/resources/golden/androidx.compose.compiler.plugins.kotlin.ComposerParamTransformTests/composableCallInAnonymousObjectInitializer[useFir = true].txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import androidx.compose.runtime.*
2828
@Composable
2929
fun Test(inputs: List<Int>, %composer: Composer?, %changed: Int) {
3030
%composer = %composer.startRestartGroup(<>)
31-
sourceInformation(%composer, "C(Test):Test.kt")
31+
sourceInformation(%composer, "C(Test)N(inputs):Test.kt")
3232
val %dirty = %changed
3333
if (%changed and 0b0110 == 0) {
3434
%dirty = %dirty or if (%composer.changedInstance(inputs)) 0b0100 else 0b0010

plugins/compose/compiler-hosted/integration-tests/src/jvmTest/resources/golden/androidx.compose.compiler.plugins.kotlin.ComposerParamTransformTests/composeValueClassDefaultParameter[useFir = true].txt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ abstract class Test {
2626
@Composable
2727
fun Example(data: Data?, intData: IntData, %composer: Composer?, %changed: Int, %default: Int) {
2828
%composer = %composer.startRestartGroup(<>)
29-
sourceInformation(%composer, "C(Example)P(0:Data,1:IntData):Test.kt")
29+
sourceInformation(%composer, "C(Example)N(data:Data,intData:IntData):Test.kt")
3030
if (%composer.shouldExecute(%changed and 0b0001 != 0, %changed and 0b0001)) {
3131
if (%default and 0b0001 != 0) {
3232
data = Data("")
@@ -50,7 +50,7 @@ fun Example(data: Data?, intData: IntData, %composer: Composer?, %changed: Int,
5050
@Composable
5151
fun ExampleNullable(data: Data?, intData: IntData, %composer: Composer?, %changed: Int, %default: Int) {
5252
%composer = %composer.startRestartGroup(<>)
53-
sourceInformation(%composer, "C(ExampleNullable)P(0:Data,1:IntData):Test.kt")
53+
sourceInformation(%composer, "C(ExampleNullable)N(data:Data,intData:IntData):Test.kt")
5454
if (%composer.shouldExecute(%changed and 0b0001 != 0, %changed and 0b0001)) {
5555
if (%default and 0b0001 != 0) {
5656
data = Data("")
@@ -74,7 +74,7 @@ fun ExampleNullable(data: Data?, intData: IntData, %composer: Composer?, %change
7474
@Composable
7575
fun ExampleNullableData(data: NullableData?, intData: IntData, %composer: Composer?, %changed: Int, %default: Int) {
7676
%composer = %composer.startRestartGroup(<>)
77-
sourceInformation(%composer, "C(ExampleNullableData)P(0:NullableData,1:IntData):Test.kt")
77+
sourceInformation(%composer, "C(ExampleNullableData)N(data:NullableData,intData:IntData):Test.kt")
7878
if (%composer.shouldExecute(%changed and 0b0001 != 0, %changed and 0b0001)) {
7979
if (%default and 0b0001 != 0) {
8080
data = NullableData(null)
@@ -98,7 +98,7 @@ fun ExampleNullableData(data: NullableData?, intData: IntData, %composer: Compos
9898
@Composable
9999
private fun PrivateExample(data: Data?, intData: IntData, %composer: Composer?, %changed: Int, %default: Int) {
100100
%composer = %composer.startRestartGroup(<>)
101-
sourceInformation(%composer, "C(PrivateExample)P(0:Data,1:IntData):Test.kt")
101+
sourceInformation(%composer, "C(PrivateExample)N(data:Data,intData:IntData):Test.kt")
102102
if (%composer.shouldExecute(%changed and 0b0001 != 0, %changed and 0b0001)) {
103103
if (%default and 0b0001 != 0) {
104104
data = Data("")
@@ -122,7 +122,7 @@ private fun PrivateExample(data: Data?, intData: IntData, %composer: Composer?,
122122
@Composable
123123
internal fun InternalExample(data: Data?, intData: IntData, %composer: Composer?, %changed: Int, %default: Int) {
124124
%composer = %composer.startRestartGroup(<>)
125-
sourceInformation(%composer, "C(InternalExample)P(0:Data,1:IntData):Test.kt")
125+
sourceInformation(%composer, "C(InternalExample)N(data:Data,intData:IntData):Test.kt")
126126
if (%composer.shouldExecute(%changed and 0b0001 != 0, %changed and 0b0001)) {
127127
if (%default and 0b0001 != 0) {
128128
data = Data("")
@@ -147,7 +147,7 @@ internal fun InternalExample(data: Data?, intData: IntData, %composer: Composer?
147147
@PublishedApi
148148
internal fun PublishedExample(data: Data?, intData: IntData, %composer: Composer?, %changed: Int, %default: Int) {
149149
%composer = %composer.startRestartGroup(<>)
150-
sourceInformation(%composer, "C(PublishedExample)P(0:Data,1:IntData):Test.kt")
150+
sourceInformation(%composer, "C(PublishedExample)N(data:Data,intData:IntData):Test.kt")
151151
if (%composer.shouldExecute(%changed and 0b0001 != 0, %changed and 0b0001)) {
152152
if (%default and 0b0001 != 0) {
153153
data = Data("")
@@ -173,7 +173,7 @@ abstract class Test {
173173
@Composable
174174
private fun PrivateExample(data: Data?, %composer: Composer?, %changed: Int, %default: Int) {
175175
%composer = %composer.startRestartGroup(<>)
176-
sourceInformation(%composer, "C(PrivateExample)P(0:Data):Test.kt")
176+
sourceInformation(%composer, "C(PrivateExample)N(data:Data):Test.kt")
177177
if (%composer.shouldExecute(%changed and 0b0001 != 0, %changed and 0b0001)) {
178178
if (%default and 0b0001 != 0) {
179179
data = Data("")
@@ -195,7 +195,7 @@ abstract class Test {
195195
@Composable
196196
fun PublicExample(data: Data?, %composer: Composer?, %changed: Int, %default: Int) {
197197
%composer = %composer.startRestartGroup(<>)
198-
sourceInformation(%composer, "C(PublicExample)P(0:Data):Test.kt")
198+
sourceInformation(%composer, "C(PublicExample)N(data:Data):Test.kt")
199199
if (%composer.shouldExecute(%changed and 0b0001 != 0, %changed and 0b0001)) {
200200
if (%default and 0b0001 != 0) {
201201
data = Data("")
@@ -217,7 +217,7 @@ abstract class Test {
217217
@Composable
218218
internal fun InternalExample(data: Data?, %composer: Composer?, %changed: Int, %default: Int) {
219219
%composer = %composer.startRestartGroup(<>)
220-
sourceInformation(%composer, "C(InternalExample)P(0:Data):Test.kt")
220+
sourceInformation(%composer, "C(InternalExample)N(data:Data):Test.kt")
221221
if (%composer.shouldExecute(%changed and 0b0001 != 0, %changed and 0b0001)) {
222222
if (%default and 0b0001 != 0) {
223223
data = Data("")
@@ -240,7 +240,7 @@ abstract class Test {
240240
@PublishedApi
241241
internal fun PublishedExample(data: Data?, %composer: Composer?, %changed: Int, %default: Int) {
242242
%composer = %composer.startRestartGroup(<>)
243-
sourceInformation(%composer, "C(PublishedExample)P(0:Data):Test.kt")
243+
sourceInformation(%composer, "C(PublishedExample)N(data:Data):Test.kt")
244244
if (%composer.shouldExecute(%changed and 0b0001 != 0, %changed and 0b0001)) {
245245
if (%default and 0b0001 != 0) {
246246
data = Data("")
@@ -262,7 +262,7 @@ abstract class Test {
262262
@Composable
263263
protected fun ProtectedExample(data: Data?, %composer: Composer?, %changed: Int, %default: Int) {
264264
%composer = %composer.startRestartGroup(<>)
265-
sourceInformation(%composer, "C(ProtectedExample)P(0:Data):Test.kt")
265+
sourceInformation(%composer, "C(ProtectedExample)N(data:Data):Test.kt")
266266
if (%composer.shouldExecute(%changed and 0b0001 != 0, %changed and 0b0001)) {
267267
if (%default and 0b0001 != 0) {
268268
data = Data("")

plugins/compose/compiler-hosted/integration-tests/src/jvmTest/resources/golden/androidx.compose.compiler.plugins.kotlin.ComposerParamTransformTests/lambdaWith10Params[useFir = true].txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ fun BrokenComposable(
4242
@Composable
4343
fun BrokenComposable(composableParameter: Function13<@[ParameterName(name = 'parameter1')] String, @[ParameterName(name = 'parameter2')] String, @[ParameterName(name = 'parameter3')] String, @[ParameterName(name = 'parameter4')] String, @[ParameterName(name = 'parameter5')] String, @[ParameterName(name = 'parameter6')] String, @[ParameterName(name = 'parameter7')] String, @[ParameterName(name = 'parameter8')] String, @[ParameterName(name = 'parameter9')] String, @[ParameterName(name = 'parameter10')] String, Composer, Int, Int, Unit>, %composer: Composer?, %changed: Int) {
4444
%composer = %composer.startRestartGroup(<>)
45-
sourceInformation(%composer, "C(BrokenComposable)<{>:Test.kt")
45+
sourceInformation(%composer, "C(BrokenComposable)N(composableParameter)<{>:Test.kt")
4646
val %dirty = %changed
4747
if (%changed and 0b0110 == 0) {
4848
%dirty = %dirty or if (%composer.changedInstance(composableParameter)) 0b0100 else 0b0010

plugins/compose/compiler-hosted/integration-tests/src/jvmTest/resources/golden/androidx.compose.compiler.plugins.kotlin.ComposerParamTransformTests/testComposableNestedCall[useFir = true].txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import androidx.compose.runtime.NonRestartableComposable
3636
@ComposableInferredTarget(scheme = "[0[0]]")
3737
fun composeVector(composable: Function2<Composer, Int, Unit>, %composer: Composer?, %changed: Int) {
3838
%composer = %composer.startRestartGroup(<>)
39-
sourceInformation(%composer, "C(composeVector)<emit>:Test.kt#2487m")
39+
sourceInformation(%composer, "C(composeVector)N(composable)<emit>:Test.kt#2487m")
4040
val %dirty = %changed
4141
if (%changed and 0b0110 == 0) {
4242
%dirty = %dirty or if (%composer.changedInstance(composable)) 0b0100 else 0b0010
@@ -67,7 +67,7 @@ fun composeVector(composable: Function2<Composer, Int, Unit>, %composer: Compose
6767
@Composable
6868
@ComposableInferredTarget(scheme = "[0[0]]")
6969
fun emit(composable: Function2<Composer, Int, Unit>, %composer: Composer?, %changed: Int) {
70-
sourceInformationMarkerStart(%composer, <>, "CC(emit)<compos...>:Test.kt#2487m")
70+
sourceInformationMarkerStart(%composer, <>, "CC(emit)N(composable)<compos...>:Test.kt#2487m")
7171
composable(%composer, 0b1110 and %changed)
7272
sourceInformationMarkerEnd(%composer)
7373
}

plugins/compose/compiler-hosted/integration-tests/src/jvmTest/resources/golden/androidx.compose.compiler.plugins.kotlin.ComposerParamTransformTests/testDelegateCall[useFir = true].txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class Foo {
4949
}
5050
@Composable
5151
fun Foo.getValue(thisObj: Any?, property: KProperty<*>, %composer: Composer?, %changed: Int): Foo {
52-
sourceInformationMarkerStart(%composer, <>, "C(getValue)P(1):Test.kt#2487m")
52+
sourceInformationMarkerStart(%composer, <>, "C(getValue)N(thisObj,property):Test.kt#2487m")
5353
if (isTraceInProgress()) {
5454
traceEventStart(<>, %changed, -1, <>)
5555
}
@@ -64,7 +64,7 @@ fun Foo.getValue(thisObj: Any?, property: KProperty<*>, %composer: Composer?, %c
6464
class FooDelegate {
6565
@Composable
6666
fun getValue(thisObj: Any?, property: KProperty<*>, %composer: Composer?, %changed: Int): FooDelegate {
67-
sourceInformationMarkerStart(%composer, <>, "C(getValue)P(1):Test.kt#2487m")
67+
sourceInformationMarkerStart(%composer, <>, "C(getValue)N(thisObj,property):Test.kt#2487m")
6868
if (isTraceInProgress()) {
6969
traceEventStart(<>, %changed, -1, <>)
7070
}

0 commit comments

Comments
 (0)