Skip to content

Commit c1bbb47

Browse files
derekxu16KotlinBuild
authored andcommitted
Infer the stability of all interfaces to be Stability.Unknown
...expect for those explicitly marked as known stable Relnote: "Started inferring the stability of all interfaces to be `Stability.Unknown`, expect for those explicitly marked as known stable."
1 parent a7902c2 commit c1bbb47

35 files changed

Lines changed: 269 additions & 75 deletions

File tree

plugins/compose/compiler-hosted/integration-tests/src/jvmTest/kotlin/androidx/compose/compiler/plugins/kotlin/ClassStabilityTransformTests.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ class ClassStabilityTransformTests(useFir: Boolean) : AbstractIrTransformTest(us
141141
)
142142

143143
@Test
144-
fun testLazyValIsUnstable() = assertStability(
144+
fun testLazyValIsUncertain() = assertStability(
145145
"class Foo(value: Int) { val square by lazy { value * value } }",
146-
"Unstable"
146+
"Uncertain(Lazy)"
147147
)
148148

149149
@Test
@@ -178,7 +178,7 @@ class ClassStabilityTransformTests(useFir: Boolean) : AbstractIrTransformTest(us
178178
@Test
179179
fun testTypeParameterWithNonExactBackingFieldType() = assertStability(
180180
"class Foo<T>(val a: List<T>)",
181-
"Unstable"
181+
"Uncertain(List)"
182182
)
183183

184184
@Test

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,12 @@ fun <T> X(items: List<T>, itemContent: Function3<T, Composer, Int, Unit>, %compo
5757
sourceInformation(%composer, "C(X)P(1)*<itemCo...>:Test.kt")
5858
val %dirty = %changed
5959
if (%changed and 0b0110 == 0) {
60-
%dirty = %dirty or if (%composer.changedInstance(items)) 0b0100 else 0b0010
60+
%dirty = %dirty or if (if (%changed and 0b1000 == 0) {
61+
%composer.changed(items)
62+
} else {
63+
%composer.changedInstance(items)
64+
}
65+
) 0b0100 else 0b0010
6166
}
6267
if (%changed and 0b00110000 == 0) {
6368
%dirty = %dirty or if (%composer.changedInstance(itemContent)) 0b00100000 else 0b00010000
@@ -87,7 +92,12 @@ fun C(items: List<String>, %composer: Composer?, %changed: Int) {
8792
sourceInformation(%composer, "C(C)<X(item...>:Test.kt")
8893
val %dirty = %changed
8994
if (%changed and 0b0110 == 0) {
90-
%dirty = %dirty or if (%composer.changedInstance(items)) 0b0100 else 0b0010
95+
%dirty = %dirty or if (if (%changed and 0b1000 == 0) {
96+
%composer.changed(items)
97+
} else {
98+
%composer.changedInstance(items)
99+
}
100+
) 0b0100 else 0b0010
91101
}
92102
if (%composer.shouldExecute(%dirty and 0b0011 != 0b0010, %dirty and 0b0001)) {
93103
if (isTraceInProgress()) {

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,12 @@ fun <T> X(items: List<T>, itemContent: Function3<T, Composer, Int, Unit>, %compo
5757
sourceInformation(%composer, "C(X)N(items,itemContent)*<itemCo...>:Test.kt")
5858
val %dirty = %changed
5959
if (%changed and 0b0110 == 0) {
60-
%dirty = %dirty or if (%composer.changedInstance(items)) 0b0100 else 0b0010
60+
%dirty = %dirty or if (if (%changed and 0b1000 == 0) {
61+
%composer.changed(items)
62+
} else {
63+
%composer.changedInstance(items)
64+
}
65+
) 0b0100 else 0b0010
6166
}
6267
if (%changed and 0b00110000 == 0) {
6368
%dirty = %dirty or if (%composer.changedInstance(itemContent)) 0b00100000 else 0b00010000
@@ -87,7 +92,12 @@ fun C(items: List<String>, %composer: Composer?, %changed: Int) {
8792
sourceInformation(%composer, "C(C)N(items)<X(item...>:Test.kt")
8893
val %dirty = %changed
8994
if (%changed and 0b0110 == 0) {
90-
%dirty = %dirty or if (%composer.changedInstance(items)) 0b0100 else 0b0010
95+
%dirty = %dirty or if (if (%changed and 0b1000 == 0) {
96+
%composer.changed(items)
97+
} else {
98+
%composer.changedInstance(items)
99+
}
100+
) 0b0100 else 0b0010
91101
}
92102
if (%composer.shouldExecute(%dirty and 0b0011 != 0b0010, %dirty and 0b0001)) {
93103
if (isTraceInProgress()) {

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@ fun Test(inputs: List<Int>, %composer: Composer?, %changed: Int) {
3131
sourceInformation(%composer, "C(Test):Test.kt")
3232
val %dirty = %changed
3333
if (%changed and 0b0110 == 0) {
34-
%dirty = %dirty or if (%composer.changedInstance(inputs)) 0b0100 else 0b0010
34+
%dirty = %dirty or if (if (%changed and 0b1000 == 0) {
35+
%composer.changed(inputs)
36+
} else {
37+
%composer.changedInstance(inputs)
38+
}
39+
) 0b0100 else 0b0010
3540
}
3641
if (%composer.shouldExecute(%dirty and 0b0011 != 0b0010, %dirty and 0b0001)) {
3742
if (isTraceInProgress()) {

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@ fun Test(inputs: List<Int>, %composer: Composer?, %changed: Int) {
3131
sourceInformation(%composer, "C(Test)N(inputs):Test.kt")
3232
val %dirty = %changed
3333
if (%changed and 0b0110 == 0) {
34-
%dirty = %dirty or if (%composer.changedInstance(inputs)) 0b0100 else 0b0010
34+
%dirty = %dirty or if (if (%changed and 0b1000 == 0) {
35+
%composer.changed(inputs)
36+
} else {
37+
%composer.changedInstance(inputs)
38+
}
39+
) 0b0100 else 0b0010
3540
}
3641
if (%composer.shouldExecute(%dirty and 0b0011 != 0b0010, %dirty and 0b0001)) {
3742
if (isTraceInProgress()) {

plugins/compose/compiler-hosted/integration-tests/src/jvmTest/resources/golden/androidx.compose.compiler.plugins.kotlin.ControlFlowTransformTests/testGroupsInLoops[useFir = false].txt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@ private fun KeyContent1(items: List<Int>, %composer: Composer?, %changed: Int) {
4040
sourceInformation(%composer, "C(KeyContent1):Test.kt")
4141
val %dirty = %changed
4242
if (%changed and 0b0110 == 0) {
43-
%dirty = %dirty or if (%composer.changedInstance(items)) 0b0100 else 0b0010
43+
%dirty = %dirty or if (if (%changed and 0b1000 == 0) {
44+
%composer.changed(items)
45+
} else {
46+
%composer.changedInstance(items)
47+
}
48+
) 0b0100 else 0b0010
4449
}
4550
if (%composer.shouldExecute(%dirty and 0b0011 != 0b0010, %dirty and 0b0001)) {
4651
if (isTraceInProgress()) {
@@ -84,7 +89,12 @@ private fun KeyContent2(items: List<Int>, %composer: Composer?, %changed: Int) {
8489
sourceInformation(%composer, "C(KeyContent2):Test.kt")
8590
val %dirty = %changed
8691
if (%changed and 0b0110 == 0) {
87-
%dirty = %dirty or if (%composer.changedInstance(items)) 0b0100 else 0b0010
92+
%dirty = %dirty or if (if (%changed and 0b1000 == 0) {
93+
%composer.changed(items)
94+
} else {
95+
%composer.changedInstance(items)
96+
}
97+
) 0b0100 else 0b0010
8898
}
8999
if (%composer.shouldExecute(%dirty and 0b0011 != 0b0010, %dirty and 0b0001)) {
90100
if (isTraceInProgress()) {

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@ private fun KeyContent1(items: List<Int>, %composer: Composer?, %changed: Int) {
4040
sourceInformation(%composer, "C(KeyContent1)N(items):Test.kt")
4141
val %dirty = %changed
4242
if (%changed and 0b0110 == 0) {
43-
%dirty = %dirty or if (%composer.changedInstance(items)) 0b0100 else 0b0010
43+
%dirty = %dirty or if (if (%changed and 0b1000 == 0) {
44+
%composer.changed(items)
45+
} else {
46+
%composer.changedInstance(items)
47+
}
48+
) 0b0100 else 0b0010
4449
}
4550
if (%composer.shouldExecute(%dirty and 0b0011 != 0b0010, %dirty and 0b0001)) {
4651
if (isTraceInProgress()) {
@@ -80,7 +85,12 @@ private fun KeyContent2(items: List<Int>, %composer: Composer?, %changed: Int) {
8085
sourceInformation(%composer, "C(KeyContent2)N(items):Test.kt")
8186
val %dirty = %changed
8287
if (%changed and 0b0110 == 0) {
83-
%dirty = %dirty or if (%composer.changedInstance(items)) 0b0100 else 0b0010
88+
%dirty = %dirty or if (if (%changed and 0b1000 == 0) {
89+
%composer.changed(items)
90+
} else {
91+
%composer.changedInstance(items)
92+
}
93+
) 0b0100 else 0b0010
8494
}
8595
if (%composer.shouldExecute(%dirty and 0b0011 != 0b0010, %dirty and 0b0001)) {
8696
if (isTraceInProgress()) {

plugins/compose/compiler-hosted/integration-tests/src/jvmTest/resources/golden/androidx.compose.compiler.plugins.kotlin.ControlFlowTransformTests/testOrderingOfPushedEndCallsWithEarlyReturns[useFir = false].txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,12 @@ fun Example(items: Iterator<Int>, %composer: Composer?, %changed: Int) {
3636
sourceInformation(%composer, "C(Example)*<P(i)>,<P(l)>:Test.kt")
3737
val %dirty = %changed
3838
if (%changed and 0b0110 == 0) {
39-
%dirty = %dirty or if (%composer.changedInstance(items)) 0b0100 else 0b0010
39+
%dirty = %dirty or if (if (%changed and 0b1000 == 0) {
40+
%composer.changed(items)
41+
} else {
42+
%composer.changedInstance(items)
43+
}
44+
) 0b0100 else 0b0010
4045
}
4146
if (%composer.shouldExecute(%dirty and 0b0011 != 0b0010, %dirty and 0b0001)) {
4247
if (isTraceInProgress()) {

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,12 @@ fun Example(items: Iterator<Int>, %composer: Composer?, %changed: Int) {
3636
sourceInformation(%composer, "C(Example)N(items)*<P(i)>,<P(l)>:Test.kt")
3737
val %dirty = %changed
3838
if (%changed and 0b0110 == 0) {
39-
%dirty = %dirty or if (%composer.changedInstance(items)) 0b0100 else 0b0010
39+
%dirty = %dirty or if (if (%changed and 0b1000 == 0) {
40+
%composer.changed(items)
41+
} else {
42+
%composer.changedInstance(items)
43+
}
44+
) 0b0100 else 0b0010
4045
}
4146
if (%composer.shouldExecute(%dirty and 0b0011 != 0b0010, %dirty and 0b0001)) {
4247
if (isTraceInProgress()) {

plugins/compose/compiler-hosted/integration-tests/src/jvmTest/resources/golden/androidx.compose.compiler.plugins.kotlin.FunctionBodySkippingTransformTests/testManyNonOptionalParams[useFir = false].txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,12 @@ fun Test(a: Int, b: Boolean, c: Int, d: Foo?, e: List<Int>?, %composer: Composer
3838
if (%default and 0b00010000 != 0) {
3939
%dirty = %dirty or 0b0110000000000000
4040
} else if (%changed and 0b0110000000000000 == 0) {
41-
%dirty = %dirty or if (%composer.changedInstance(e)) 0b0100000000000000 else 0b0010000000000000
41+
%dirty = %dirty or if (if (%changed and 0b1000000000000000 == 0) {
42+
%composer.changed(e)
43+
} else {
44+
%composer.changedInstance(e)
45+
}
46+
) 0b0100000000000000 else 0b0010000000000000
4247
}
4348
if (%composer.shouldExecute(%dirty and 0b0010010010010011 != 0b0010010010010010, %dirty and 0b0001)) {
4449
%composer.startDefaults()

0 commit comments

Comments
 (0)