FIR: Fix inference of builder-inference function from expect type

Previously, such calls were being completed with FULL mode and incorrect
INFERENCE_NO_INFORMATION_FOR_PARAMETER has been reported
This commit is contained in:
Denis.Zharkov
2021-06-01 21:01:46 +03:00
committed by TeamCityServer
parent 18e93b50d9
commit 592256976e
14 changed files with 72 additions and 58 deletions
@@ -0,0 +1,17 @@
// WITH_RUNTIME
// TARGET_BACKEND: JVM_IR
@OptIn(ExperimentalStdlibApi::class)
fun getAllPossibleNames(subScopes: List<List<String>>): Set<String> = withValidityAssertion {
buildSet {
subScopes.flatMapTo(this) { it }
}
}
inline fun <R> withValidityAssertion(action: () -> R): R {
return action()
}
fun box(): String {
return getAllPossibleNames(listOf(listOf("O"), listOf("K"))).joinToString("")
}
@@ -1,6 +1,5 @@
// ISSUE: KT-41164
// WITH_RUNTIME
// IGNORE_BACKEND_FIR: JVM_IR
// DONT_TARGET_EXACT_BACKEND: WASM
import kotlin.experimental.ExperimentalTypeInference