[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:
committed by
Space Team
parent
fb38ab3cbb
commit
f7063555ca
+3
-1
@@ -121,7 +121,9 @@ private fun IrSimpleFunction.createSuspendFunctionStub(context: CommonBackendCon
|
||||
function.copyReceiverParametersFrom(this, substitutionMap)
|
||||
|
||||
function.overriddenSymbols += overriddenSymbols.map {
|
||||
it.owner.getOrCreateFunctionWithContinuationStub(context).symbol
|
||||
factory.stageController.restrictTo(it.owner) {
|
||||
it.owner.getOrCreateFunctionWithContinuationStub(context).symbol
|
||||
}
|
||||
}
|
||||
function.valueParameters = valueParameters.map { it.copyTo(function) }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user