[NI] Restore missing call checker errors in coroutine inference
Reported diagnostics from the call checkers didn't get to a top-level trace, if an intermediate wrapping call was a lambda call. Use of the top-level trace in call completer is a workaround for the unreliable commit order of common calls' temporary traces. ^KT-33542 Fixed
This commit is contained in:
+26
@@ -0,0 +1,26 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
|
||||
import kotlin.experimental.ExperimentalTypeInference
|
||||
|
||||
interface In<in E> {
|
||||
fun send(element: E)
|
||||
}
|
||||
|
||||
class InImpl<E> : In<E> {
|
||||
override fun send(element: E) {}
|
||||
}
|
||||
|
||||
@<!DEPRECATION, EXPERIMENTAL_IS_NOT_ENABLED!>UseExperimental<!>(ExperimentalTypeInference::class)
|
||||
public fun <T> builder(@BuilderInference block: In<T>.() -> Unit) {
|
||||
InImpl<T>().block()
|
||||
}
|
||||
|
||||
suspend fun yield() {}
|
||||
|
||||
fun test() {
|
||||
builder {
|
||||
send(run {
|
||||
<!ILLEGAL_SUSPEND_FUNCTION_CALL!>yield<!>() // No error but `yield` is not inside "suspension" context actually
|
||||
})
|
||||
}
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package
|
||||
|
||||
@kotlin.UseExperimental(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun </*0*/ T> builder(/*0*/ @kotlin.BuilderInference block: In<T>.() -> kotlin.Unit): kotlin.Unit
|
||||
public fun test(): kotlin.Unit
|
||||
public suspend fun yield(): kotlin.Unit
|
||||
|
||||
public interface In</*0*/ in E> {
|
||||
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 abstract fun send(/*0*/ element: E): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class InImpl</*0*/ E> : In<E> {
|
||||
public constructor InImpl</*0*/ E>()
|
||||
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*/ fun send(/*0*/ element: E): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
Reference in New Issue
Block a user