JVM IR: Fix types in EnumClassLowering

This commit is contained in:
Steven Schäfer
2019-11-07 16:03:41 +01:00
committed by Alexander Udalov
parent 492a46206b
commit 9ef627ebec
@@ -490,7 +490,7 @@ private class EnumClassLowering(val context: JvmBackendContext) : ClassLoweringP
IrReturnImpl(
UNDEFINED_OFFSET,
UNDEFINED_OFFSET,
irClass.defaultType,
context.irBuiltIns.nothingType,
valueOfFunction.symbol,
irValueOfCall
)
@@ -502,7 +502,8 @@ private class EnumClassLowering(val context: JvmBackendContext) : ClassLoweringP
val cloneFun = context.irBuiltIns.arrayClass.owner.functions.find { it.name.asString() == "clone" }!!
val returnType = valuesFunction.symbol.owner.returnType
val irCloneValues =
IrCallImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, returnType, cloneFun.symbol, 0).apply {
IrCallImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, returnType, cloneFun.symbol, 1).apply {
putTypeArgument(0, irClass.defaultType)
dispatchReceiver =
IrGetFieldImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, valuesField.symbol, valuesField.symbol.owner.type)
}
@@ -513,7 +514,7 @@ private class EnumClassLowering(val context: JvmBackendContext) : ClassLoweringP
IrReturnImpl(
UNDEFINED_OFFSET,
UNDEFINED_OFFSET,
returnType,
context.irBuiltIns.nothingType,
valuesFunction.symbol,
irCloneValues
)