diff --git a/compiler/testData/codegen/box/polymorphicSignature/invokeExactWithInlineClass.kt b/compiler/testData/codegen/box/polymorphicSignature/invokeExactWithInlineClass.kt index bd41ed50af3..615b6416b23 100644 --- a/compiler/testData/codegen/box/polymorphicSignature/invokeExactWithInlineClass.kt +++ b/compiler/testData/codegen/box/polymorphicSignature/invokeExactWithInlineClass.kt @@ -15,8 +15,10 @@ fun box(): String { val mh = MethodHandles.lookup().unreflect(::foo.javaMethod!!) // TODO: it's unclear whether this should throw or not, see KT-28214. - val r1 = mh.invokeExact(Z("OK")) as String - if (r1 != "OK") return "Fail r1: $r1" - - return mh.invokeExact("OK") as String + return try { + mh.invokeExact(Z("OK")) + "FAIL" + } catch (ignored: java.lang.invoke.WrongMethodTypeException) { + "OK" + } }