mirror of
https://github.com/jlengrand/compose-multiplatform.git
synced 2026-05-13 08:11:26 +00:00
web: add compiler test case for type nullable params (#1227)
Co-authored-by: Oleksandr Karpovich <oleksandr.karpovich@jetbrains.com>
This commit is contained in:
committed by
GitHub
parent
6d7c8a5d80
commit
326a130ab8
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
) {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user