web: add compiler test case for type nullable params (#1227)

Co-authored-by: Oleksandr Karpovich <oleksandr.karpovich@jetbrains.com>
This commit is contained in:
Oleksandr Karpovich
2021-10-04 11:06:49 +02:00
committed by GitHub
parent 6d7c8a5d80
commit 326a130ab8
2 changed files with 35 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
// @Module:Main
// https://github.com/JetBrains/compose-jb/issues/1226
import kotlin.reflect.KProperty
import androidx.compose.runtime.Composable
@Composable
fun <T> MySelect(
options: List<T>,
onChange: (T?) -> Unit
) {
}
fun main() {
callComposable {
MySelect<String>(
options = emptyList(),
onChange = {}
)
}
}
fun callComposable(content: @Composable () -> Unit) {
// does nothing
}

View File

@@ -9,6 +9,7 @@ fun main() {
FooTakesTypedComposableLambda { "text" }
FooTakesTypedComposableLambda2(10) { it + 100 }
FooTakesTypedExtesionComposableLambda<String, Any, Unit>("text", Any()) { }
MySelect<String>(emptyList(), {})
}
}
@@ -34,3 +35,10 @@ fun <T> FooTakesTypedComposableLambda2(t: T, composable: @Composable (T) -> T) {
fun <T, K, R> FooTakesTypedExtesionComposableLambda(t: T, k: K, composable: @Composable T.(K) -> R) {
t.composable(k)
}
@Composable
fun <T> MySelect(
options: List<T>,
onChange: (T) -> Unit
) {
}