Do not add continuation parameter for super interface bridges

If there is superinterface (more specifically, fun interface) in one
file with default suspend function, we lower the function, adding
continuation parameter. Then, when we compile another file with a child,
we generate a bridge to the default suspend function, which is already
lowered. So, we do not need to add the continuation parameter.

If the child is in the same file, then we add continuation parameter
after we create a bridge, so, AddContinuationLowering can encounter
bridges to suspend default functions in superinterfaces with
continuation parameter only in multifile examples.

 #KT-47549 Fixed
This commit is contained in:
Ilmir Usmanov
2021-12-02 00:43:40 +01:00
committed by Space
parent be6409f0af
commit b26a81435f
12 changed files with 253 additions and 47 deletions
@@ -0,0 +1,12 @@
// WITH_STDLIB
// FILE: 1.kt
fun interface I {
fun f(): String
suspend fun s() {}
}
// FILE: box.kt
fun box(): String =
I { "OK" }.f()
@@ -0,0 +1,10 @@
// WITH_STDLIB
fun interface I {
fun f(): String
suspend fun s() {}
}
fun box(): String =
I { "OK" }.f()