Don't check suitability of a builder inference call if unrestricted builder inference is enabled

^KT-42139 Fixed
This commit is contained in:
Victor Petukhov
2021-06-03 13:15:41 +03:00
parent f8fbbc01b6
commit 19c07e048a
10 changed files with 81 additions and 13 deletions
@@ -0,0 +1,26 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// !LANGUAGE: +UnrestrictedBuilderInference
// WITH_RUNTIME
fun <R> select(vararg x: R) = x[0]
fun <K> myEmptyList(): List<K> = emptyList()
fun f1(): Sequence<List<Int>> = sequence {
yield(myEmptyList())
}
fun f2(): Sequence<List<Int>> = sequence {
select(yield(myEmptyList()), yield(myEmptyList()))
}
fun f3(): Sequence<List<Int>> = sequence {
if (true) yield(myEmptyList()) // [NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER] Not enough information to infer type variable T
else yield(myEmptyList()) // [NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER] Not enough information to infer type variable T
}
fun box(): String {
f1()
f2()
f3()
return "OK"
}