Don't check suitability of a builder inference call if unrestricted builder inference is enabled
^KT-42139 Fixed
This commit is contained in:
@@ -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"
|
||||
}
|
||||
Reference in New Issue
Block a user