[IR BE] Support lateinit locals and isInitialized property

* update tests
This commit is contained in:
Roman Artemev
2018-10-29 22:09:32 +03:00
committed by romanart
parent 535eea7f48
commit 2d03f87ea5
16 changed files with 72 additions and 32 deletions
@@ -206,6 +206,14 @@ class JsIrBackendContext(
NoLookupLocation.FROM_BACKEND
).filterNot { it.isExpect }.single().getter!!
)
override val lateinitIsInitializedPropertyGetter = symbolTable.referenceSimpleFunction(
module.getPackage(kotlinPackageFqn).memberScope.getContributedVariables(
Name.identifier("isInitialized"), NoLookupLocation.FROM_BACKEND
).single {
it.extensionReceiverParameter != null && !it.isExternal
}.getter!!
)
}
override fun shouldGenerateHandlerParameterForDefaultBodyFun() = true
@@ -77,6 +77,7 @@ fun compile(
ExpectDeclarationsRemoving(context).lower(moduleFragment)
CoroutineIntrinsicLowering(context).lower(moduleFragment)
ArrayInlineConstructorLowering(context).lower(moduleFragment)
LateinitLowering(context, true).lower(moduleFragment)
val moduleFragmentCopy = moduleFragment.deepCopyWithSymbols()