JC IR IC: correct signatures for function types created during lowerings

This commit is contained in:
Anton Bannykh
2021-07-09 11:56:36 +03:00
committed by teamcityserver
parent 8553c6ef58
commit 058ca16af7
2 changed files with 11 additions and 0 deletions
@@ -243,6 +243,14 @@ class JsIrBackendContext(
override val functionAdapter: IrClassSymbol
get() = TODO("Not implemented")
override fun functionN(n: Int): IrClassSymbol {
return irFactory.stageController.withInitialIr { super.functionN(n) }
}
override fun suspendFunctionN(n: Int): IrClassSymbol {
return irFactory.stageController.withInitialIr { super.suspendFunctionN(n) }
}
}
override fun unfoldInlineClassType(irType: IrType): IrType? {
@@ -44,10 +44,13 @@ class WholeWorldStageController : StageController() {
override fun <T> withStage(stage: Int, fn: () -> T): T {
val oldStage = currentStage
currentStage = stage
val oldCurrentDeclaration = currentDeclaration
currentDeclaration = null
return try {
fn()
} finally {
currentStage = oldStage
currentDeclaration = oldCurrentDeclaration
}
}