[JS IR BE] Fix inline classes workarounds

- Remove uninitialized return type check
- Remove unbound classifier symbol check
This commit is contained in:
Svyatoslav Kuzmich
2018-11-29 16:18:14 +03:00
parent 7cbc8e8b76
commit 8359887696
5 changed files with 27 additions and 16 deletions
@@ -37,12 +37,7 @@ class AutoboxingTransformer(val context: JsIrBackendContext) : AbstractValueUsag
if (this.symbol.owner.let { it is IrSimpleFunction && it.isSuspend }) {
irBuiltIns.anyNType
} else {
try {
this.symbol.owner.returnType
} catch (e: kotlin.UninitializedPropertyAccessException) {
// TODO: Fix lateinit return types
this.type
}
this.symbol.owner.returnType
}
}
is IrGetField -> this.symbol.owner.type
@@ -125,7 +125,7 @@ class MultipleCatchesLowering(val context: JsIrBackendContext) : FileLoweringPas
private fun buildImplicitCast(value: IrExpression, toType: IrType, toTypeSymbol: IrClassifierSymbol) =
JsIrBuilder.buildTypeOperator(toType, IrTypeOperator.IMPLICIT_CAST, value, toType, toTypeSymbol)
private fun mergeTypes(types: List<IrType>) = types.commonSupertype().also {
private fun mergeTypes(types: List<IrType>) = types.commonSupertype(context.symbolTable).also {
assert(it.isSubtypeOf(context.irBuiltIns.throwableType) || it is IrDynamicType)
}