You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Disallow open @composable functions with default params
Old version of Compose compiler allowed open functions with default params without a proper wrapper around it. We need to add some feature detection for precompiled artifacts to make sure we handle those functions correctly before enabling it.
Fixes: 357878245
Relnote: Disallow open @composable functions with default params to fix binary compatibility issues.
Copy file name to clipboardExpand all lines: plugins/compose/compiler-hosted/integration-tests/src/jvmTest/kotlin/androidx/compose/compiler/plugins/kotlin/ComposeBytecodeCodegenTest.kt
Copy file name to clipboardExpand all lines: plugins/compose/compiler-hosted/integration-tests/src/jvmTest/kotlin/androidx/compose/compiler/plugins/kotlin/ComposeCrossModuleTests.kt
Copy file name to clipboardExpand all lines: plugins/compose/compiler-hosted/integration-tests/src/jvmTest/kotlin/androidx/compose/compiler/plugins/kotlin/DefaultParamTransformTests.kt
Copy file name to clipboardExpand all lines: plugins/compose/compiler-hosted/integration-tests/src/jvmTest/kotlin/androidx/compose/compiler/plugins/kotlin/analysis/ComposableDeclarationCheckerTests.kt
+2-2
Original file line number
Diff line number
Diff line change
@@ -290,7 +290,7 @@ class ComposableDeclarationCheckerTests(useFir: Boolean) : AbstractComposeDiagno
290
290
"""
291
291
import androidx.compose.runtime.Composable
292
292
interface A {
293
-
@Composable fun foo(x: Int = 0) {}
293
+
@Composable fun foo(x: Int = <!ABSTRACT_COMPOSABLE_DEFAULT_PARAMETER_VALUE!>0<!>) {}
294
294
}
295
295
"""
296
296
)
@@ -314,7 +314,7 @@ class ComposableDeclarationCheckerTests(useFir: Boolean) : AbstractComposeDiagno
314
314
"""
315
315
import androidx.compose.runtime.Composable
316
316
open class A {
317
-
@Composable open fun foo(x: Int = 0) {}
317
+
@Composable open fun foo(x: Int = <!ABSTRACT_COMPOSABLE_DEFAULT_PARAMETER_VALUE!>0<!>) {}
0 commit comments