[JS IR BE] Fixup property accessors

This commit is contained in:
Svyatoslav Kuzmich
2019-06-17 16:36:25 +03:00
parent 84d48b8c7b
commit 3e10de9cd1
2 changed files with 9 additions and 0 deletions
@@ -154,6 +154,14 @@ class PrivateMembersLowering(val context: JsIrBackendContext) : ClassLoweringPas
}
}
// Detach old function from corresponding property
val correspondingProperty = function.correspondingPropertySymbol?.owner
if (correspondingProperty != null) {
when (function) {
correspondingProperty.getter -> correspondingProperty.getter = staticFunction
correspondingProperty.setter -> correspondingProperty.setter = staticFunction
}
}
staticFunction.typeParameters += function.typeParameters.map { it.deepCopyWithSymbols(staticFunction) }
@@ -200,6 +200,7 @@ class ThrowableSuccessorsLowering(val context: JsIrBackendContext) : FileLowerin
val function = JsIrBuilder.buildFunction(name, fakeAccessor.returnType, fakeAccessor.parent).apply {
overriddenSymbols += fakeAccessor.overriddenSymbols
correspondingPropertySymbol = fakeAccessor.correspondingPropertySymbol
correspondingPropertySymbol!!.owner.getter = this
dispatchReceiverParameter = fakeAccessor.dispatchReceiverParameter?.copyTo(this)
}