[NI] Postpone calls with not enough information in builder inference
This commit is contained in:
+35
@@ -0,0 +1,35 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !USE_EXPERIMENTAL: kotlin.Experimental
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// ISSUE: KT-35684
|
||||
|
||||
import kotlin.experimental.ExperimentalTypeInference
|
||||
|
||||
fun test_1() {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.Int>")!>sequence {
|
||||
yield(<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.Int>")!>materialize()<!>)
|
||||
yield(materialize<Int>())
|
||||
}<!>
|
||||
}
|
||||
|
||||
fun test_2() {
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>sequence<!> {
|
||||
yield(<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>materialize<!>())
|
||||
}
|
||||
}
|
||||
|
||||
fun test_3() {
|
||||
sequence {
|
||||
yield(materialize<Int>())
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>materialize<!>()
|
||||
}
|
||||
}
|
||||
|
||||
@UseExperimental(ExperimentalTypeInference::class)
|
||||
fun <U> sequence(@BuilderInference block: suspend Inv<U>.() -> Unit): U = null!!
|
||||
|
||||
interface Inv<T> {
|
||||
fun yield(element: T)
|
||||
}
|
||||
|
||||
fun <K> materialize(): Inv<K> = TODO()
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package
|
||||
|
||||
public fun </*0*/ K> materialize(): Inv<K>
|
||||
@kotlin.UseExperimental(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun </*0*/ U> sequence(/*0*/ @kotlin.BuilderInference block: suspend Inv<U>.() -> kotlin.Unit): U
|
||||
public fun test_1(): kotlin.Unit
|
||||
public fun test_2(): kotlin.Unit
|
||||
public fun test_3(): kotlin.Unit
|
||||
|
||||
public interface Inv</*0*/ T> {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public abstract fun yield(/*0*/ element: T): kotlin.Unit
|
||||
}
|
||||
Reference in New Issue
Block a user