IR: minor, make IrClass.companionObject return IrClass
(cherry picked from commit c2f34c96f96fe52b3f3fbbe5de0313d7712f67f6)
This commit is contained in:
committed by
Vasily Levchenko
parent
3d552ae7bb
commit
fd84ca039d
+2
-2
@@ -229,7 +229,7 @@ private fun InteropCallContext.convertIntegralToEnum(
|
|||||||
enumType: IrType
|
enumType: IrType
|
||||||
): IrExpression {
|
): IrExpression {
|
||||||
val enumClass = enumType.getClass()!!
|
val enumClass = enumType.getClass()!!
|
||||||
val companionClass = enumClass.companionObject()!! as IrClass
|
val companionClass = enumClass.companionObject()!!
|
||||||
val byValue = companionClass.simpleFunctions().single { it.name.asString() == "byValue" }
|
val byValue = companionClass.simpleFunctions().single { it.name.asString() == "byValue" }
|
||||||
val byValueArg = castPrimitiveIfNeeded(value, intergralType, byValue.valueParameters.first().type)
|
val byValueArg = castPrimitiveIfNeeded(value, intergralType, byValue.valueParameters.first().type)
|
||||||
return builder.irCall(byValue).apply {
|
return builder.irCall(byValue).apply {
|
||||||
@@ -474,4 +474,4 @@ private fun InteropCallContext.generateBitFieldAccess(callSite: IrCall): IrExpre
|
|||||||
}
|
}
|
||||||
else -> error("Unexpected accessor function: ${accessor.name}")
|
else -> error("Unexpected accessor function: ${accessor.name}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user