K1/K2: add a test fixing behavior of overloadResolutionByLambda/PCLA combo

This commit is contained in:
Mikhail Glukhikh
2024-02-09 10:20:57 +01:00
committed by Space Team
parent 8217aa9633
commit e532220305
8 changed files with 65 additions and 0 deletions
@@ -0,0 +1,17 @@
// WITH_STDLIB
import kotlin.experimental.ExperimentalTypeInference
@OptIn(ExperimentalTypeInference::class)
@OverloadResolutionByLambdaReturnType
fun <E1> buildL(x: MutableList<E1>.() -> Int): Int = 1
@OptIn(ExperimentalTypeInference::class)
@OverloadResolutionByLambdaReturnType
fun <E2> buildL(x: MutableList<E2>.() -> String): String = ""
fun main() {
<!OVERLOAD_RESOLUTION_AMBIGUITY!>buildL<!> {
<!UNRESOLVED_REFERENCE!>add<!>("")
""
}
}
@@ -0,0 +1,17 @@
// WITH_STDLIB
import kotlin.experimental.ExperimentalTypeInference
@OptIn(ExperimentalTypeInference::class)
@OverloadResolutionByLambdaReturnType
fun <E1> buildL(x: MutableList<E1>.() -> Int): Int = 1
@OptIn(ExperimentalTypeInference::class)
@OverloadResolutionByLambdaReturnType
fun <E2> buildL(x: MutableList<E2>.() -> String): String = ""
fun main() {
<!NONE_APPLICABLE!>buildL<!> {
<!UNRESOLVED_REFERENCE!>add<!>("")
""
}
}