JVM IR: optimize comparison with FQ name of kotlin.Result

This commit is contained in:
Alexander Udalov
2023-08-22 12:58:53 +02:00
committed by Space Team
parent 70f48db226
commit f1886f8219
4 changed files with 10 additions and 4 deletions
@@ -795,7 +795,7 @@ class ExpressionCodegen(
get() = parent.let { parent ->
val isBoxedResult = this is IrValueParameter && parent is IrSimpleFunction &&
parent.dispatchReceiverParameter != this &&
(parent.parent as? IrClass)?.fqNameWhenAvailable != StandardNames.RESULT_FQ_NAME &&
(parent.parent as? IrClass)?.isClassWithFqName(StandardNames.RESULT_FQ_NAME) != true &&
parent.resultIsActuallyAny(index) == true
return if (isBoxedResult) context.irBuiltIns.anyNType else type
}