From 3795ad1fb950091a53c25c3120f3e507485949f1 Mon Sep 17 00:00:00 2001 From: Oleksandr Karpovich Date: Tue, 5 Oct 2021 10:35:43 +0200 Subject: [PATCH] web: add compiler test case `Composable With Default Values Defined By Other Params` (#1230) Co-authored-by: Oleksandr Karpovich --- .../main-template/lib/build.gradle.kts | 1 + .../main-template/settings.gradle.kts | 1 + ...leWithDefaultValuesDefinedByOtherParams.kt | 24 +++++++++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 web/compose-compiler-integration/testcases/failing/ComposableWithDefaultValuesDefinedByOtherParams.kt diff --git a/web/compose-compiler-integration/main-template/lib/build.gradle.kts b/web/compose-compiler-integration/main-template/lib/build.gradle.kts index 784f3b836b..af3f7664a2 100644 --- a/web/compose-compiler-integration/main-template/lib/build.gradle.kts +++ b/web/compose-compiler-integration/main-template/lib/build.gradle.kts @@ -4,6 +4,7 @@ plugins { } repositories { + mavenLocal() mavenCentral() maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") } diff --git a/web/compose-compiler-integration/main-template/settings.gradle.kts b/web/compose-compiler-integration/main-template/settings.gradle.kts index 11be86e909..e2129e5abc 100644 --- a/web/compose-compiler-integration/main-template/settings.gradle.kts +++ b/web/compose-compiler-integration/main-template/settings.gradle.kts @@ -1,5 +1,6 @@ pluginManagement { repositories { + mavenLocal() gradlePluginPortal() maven { url = uri("https://maven.pkg.jetbrains.space/public/p/compose/dev") diff --git a/web/compose-compiler-integration/testcases/failing/ComposableWithDefaultValuesDefinedByOtherParams.kt b/web/compose-compiler-integration/testcases/failing/ComposableWithDefaultValuesDefinedByOtherParams.kt new file mode 100644 index 0000000000..4aa2d2f9c3 --- /dev/null +++ b/web/compose-compiler-integration/testcases/failing/ComposableWithDefaultValuesDefinedByOtherParams.kt @@ -0,0 +1,24 @@ +// @Module:Main +import androidx.compose.runtime.Composable +import androidx.compose.runtime.currentComposer +import androidx.compose.runtime.Composer + +fun main() { + callComposable { + ComposableWithDefaultParamsDefinedByOtherParams("a") + } +} + +fun callComposable(content: @Composable () -> Unit) { + val c = content +} + +// @Module:Lib +import androidx.compose.runtime.Composable + +@Composable +fun ComposableWithDefaultParamsDefinedByOtherParams( + a: String, + b: String = a +) { +}