JVM IR: do not generate invokeinterface hashCode if smart cast is present

#KT-45008 Fixed
This commit is contained in:
Alexander Udalov
2021-02-18 13:19:27 +01:00
parent 56854a8b1a
commit 56f9e3360f
5 changed files with 35 additions and 1 deletions
@@ -233,7 +233,7 @@ private class InterfaceObjectCallsLowering(val context: JvmBackendContext) : IrE
if (expression.superQualifierSymbol != null && !expression.isSuperToAny())
return super.visitCall(expression)
val callee = expression.symbol.owner
if (!callee.hasInterfaceParent())
if (!callee.hasInterfaceParent() && expression.dispatchReceiver?.run { type.erasedUpperBound.isJvmInterface } != true)
return super.visitCall(expression)
val resolved = callee.resolveFakeOverride()
if (resolved?.isMethodOfAny() != true)