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:
+12
@@ -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()
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// WITH_STDLIB
|
||||
|
||||
fun interface I {
|
||||
fun f(): String
|
||||
|
||||
suspend fun s() {}
|
||||
}
|
||||
|
||||
fun box(): String =
|
||||
I { "OK" }.f()
|
||||
Reference in New Issue
Block a user