From 69bb65496f53a4d77cfb50620ab7ca835c862f14 Mon Sep 17 00:00:00 2001 From: Ilmir Usmanov Date: Thu, 10 Dec 2020 15:13:52 +0100 Subject: [PATCH] IC Mangling: Change test since we pass boxed inline class to java method #KT-28214 --- .../polymorphicSignature/invokeExactWithInlineClass.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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" + } }