[FIR] Resolve the continuation type inside createSuspendView()

Normally such types are resolved during enhancement,
but creating the suspend view happens before
enhancement, so the type may have not been resolved.

^KT-59915 Fixed
This commit is contained in:
Nikolay Lunyak
2023-09-12 15:10:32 +03:00
committed by Space Team
parent 1467e743fd
commit aacfc31c90
5 changed files with 6 additions and 100 deletions
@@ -1,50 +0,0 @@
// FILE: I.kt
interface I {
suspend fun foo(x: Int): String
}
// FILE: JavaClass.java
import kotlin.coroutines.Continuation;
import org.jetbrains.annotations.NotNull;
public class JavaClass implements I {
@Override
public Object foo(int x, @NotNull Continuation<? super String> continuation) {
return null;
}
}
// FILE: main.kt
import kotlin.coroutines.Continuation
class K1 : JavaClass()
class K2 : JavaClass() {
override suspend fun foo(x: Int): String = ""
}
class K3 : JavaClass() {
override fun foo(x: Int, y: Continuation<String>): Any? = null
}
fun builder(block: suspend () -> Unit) {}
fun main(x: Continuation<String>) {
JavaClass().foo(5, x)
K1().foo(6, x)
K2().foo(7, x)
K3().foo(8, x)
builder {
JavaClass().foo(1)
K1().foo(2)
K2().foo(3)
K3().foo(4)
JavaClass().foo(5, x)
K1().foo(6, x)
K2().foo(7, x)
K3().foo(8, x)
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// FILE: I.kt
interface I {
@@ -1,50 +0,0 @@
// FILE: I.kt
interface I {
suspend fun foo(x: Int): String
}
// FILE: JavaClass.java
import kotlin.coroutines.Continuation;
import org.jetbrains.annotations.NotNull;
public class JavaClass implements I {
@Override
public Object foo(int x, @NotNull Continuation<? super String> continuation) {
return null;
}
}
// FILE: main.kt
import kotlin.coroutines.Continuation
class K1 : JavaClass()
class K2 : JavaClass() {
override suspend fun foo(x: Int): String = ""
}
class K3 : JavaClass() {
override fun foo(x: Int, y: Continuation<String>): Any? = null
}
fun builder(block: suspend () -> Unit) {}
fun main(x: Continuation<String>) {
JavaClass().foo(5, x)
K1().foo(6, x)
K2().foo(7, x)
K3().foo(8, x)
builder {
JavaClass().foo(1)
K1().foo(2)
K2().foo(3)
K3().foo(4)
JavaClass().foo(5, x)
K1().foo(6, x)
K2().foo(7, x)
K3().foo(8, x)
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// FILE: I.kt
interface I {