JVM IR: do not copy type parameters into suspend lambda classes
Declarations inside that class are referencing the type parameters of the containing function anyway, since we don't do any remapping. So the resulting IR is slightly more correct, and doesn't lead to type parameter/argument size mismatch error on IrBased/Wrapped-descriptors. This reverts a part of01da7f289b, which looks like it was no longer necessary after8d0ffa1444. #KT-42028 Fixed
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
|
||||
import kotlin.coroutines.*
|
||||
import helpers.*
|
||||
|
||||
interface I {
|
||||
suspend fun foo(g: suspend String.() -> Unit)
|
||||
}
|
||||
|
||||
fun builder0(f: suspend () -> Unit) {
|
||||
f.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
fun <T> builder(f: suspend I.() -> T) {
|
||||
builder0 {
|
||||
f(object : I {
|
||||
override suspend fun foo(g: suspend String.() -> Unit) {
|
||||
g("OK")
|
||||
"Force non-tail call".length
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
var result = "Fail"
|
||||
builder {
|
||||
foo {
|
||||
result = this
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
Reference in New Issue
Block a user