[JS IR] Fix the instability of LoweredDeclarationSignature

A suspend stub for the abstract function
 may be created in the context of the child function.
 If on an incremental rebuild the stub is created from
 the parent context (e.g. a file with the child is not modified),
 the resulting LoweredDeclarationSignature will be different.
 It will lead to a broken cross-module reference and broken JS code.
 Therefore it is required to wrap the creation routine
 into StageController::restrictTo() explicitly.

^KT-54934 Fixed
This commit is contained in:
Alexander Korepanov
2022-11-14 11:57:42 +01:00
committed by Space Team
parent fb38ab3cbb
commit f7063555ca
11 changed files with 76 additions and 1 deletions
@@ -0,0 +1,6 @@
class ClassA1 : InterfaceA {
override suspend fun functionA(x: Int, s: String, b: Boolean?): Int {
return 0
}
}
@@ -0,0 +1,5 @@
interface InterfaceA {
suspend fun functionA(x: Int, s: String, b: Boolean? = null): Int
}
fun function1(): Int = 0
@@ -0,0 +1,5 @@
interface InterfaceA {
suspend fun functionA(x: Int, s: String, b: Boolean? = null): Int
}
fun function1(): Int = 1
@@ -0,0 +1,9 @@
STEP 0:
modifications:
U : l1I.0.kt -> l1I.kt
U : l1A.0.kt -> l1A.kt
added file: l1I.kt, l1A.kt
STEP 1:
modifications:
U : l1I.1.kt -> l1I.kt
modified ir: l1I.kt