Fix "kotlin.UninitializedPropertyAccessException: lateinit property typeTranslator has not been initialized" in Native IR serialization plugin

This commit is contained in:
Leonid Startsev
2018-11-22 17:05:00 +03:00
parent 7c8b34fe1c
commit f13f54d5ad
@@ -47,6 +47,7 @@ val BackendContext.externalSymbols: ReferenceSymbolTable get() = ir.symbols.exte
internal fun BackendContext.createTypeTranslator(moduleDescriptor: ModuleDescriptor): TypeTranslator = internal fun BackendContext.createTypeTranslator(moduleDescriptor: ModuleDescriptor): TypeTranslator =
TypeTranslator(externalSymbols, irBuiltIns.languageVersionSettings).apply { TypeTranslator(externalSymbols, irBuiltIns.languageVersionSettings).apply {
constantValueGenerator = ConstantValueGenerator(moduleDescriptor, symbolTable = externalSymbols) constantValueGenerator = ConstantValueGenerator(moduleDescriptor, symbolTable = externalSymbols)
constantValueGenerator.typeTranslator = this
} }
interface IrBuilderExtension { interface IrBuilderExtension {