JVM_IR: Do not unbox Result parameter in Result methods

#KT-44140 Fixed
This commit is contained in:
Ilmir Usmanov
2021-01-19 12:28:02 +01:00
parent 10d9259df5
commit cce9469e6a
10 changed files with 58 additions and 0 deletions
@@ -637,6 +637,8 @@ class ExpressionCodegen(
private fun unboxResultIfNeeded(arg: IrGetValue) {
if (arg.type.erasedUpperBound.fqNameWhenAvailable != StandardNames.RESULT_FQ_NAME) return
if (irFunction !is IrSimpleFunction) return
// Skip Result's methods
if (irFunction.parentAsClass.fqNameWhenAvailable == StandardNames.RESULT_FQ_NAME) return
val index = (arg.symbol as? IrValueParameterSymbol)?.owner?.index ?: return
val genericOrAnyOverride = irFunction.overriddenSymbols.any {