From f8503ba1bfefd0d37f7af68710f26ac96a34f270 Mon Sep 17 00:00:00 2001 From: Dmitry Petrov Date: Wed, 11 Aug 2021 13:09:18 +0300 Subject: [PATCH] JVM_IR KT-47984 minor avoid using @Deprecated function in tests --- .../box/inlineArgsInPlace/noinlineParameter.kt | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/compiler/testData/codegen/box/inlineArgsInPlace/noinlineParameter.kt b/compiler/testData/codegen/box/inlineArgsInPlace/noinlineParameter.kt index 5814ab6fb15..2e984eec500 100644 --- a/compiler/testData/codegen/box/inlineArgsInPlace/noinlineParameter.kt +++ b/compiler/testData/codegen/box/inlineArgsInPlace/noinlineParameter.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: WASM // WITH_RUNTIME // TODO separate bytecode text templates for FIR? @@ -10,12 +9,10 @@ // -- 2 ASTORE 1 // -- 13 ALOAD 1 -@Suppress("DEPRECATION_ERROR") -fun box(): String { - val seq = buildSequence { - yield("O") - yield("K") - } - val it = seq.iterator() - return it.next() + it.next() -} +// NB 'b' is evaluated before 's' +@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") +@kotlin.internal.InlineOnly +inline fun invokeNoInline(noinline b: (String) -> String, s: String) = + b(s) + +fun box(): String = invokeNoInline({ it + "K" }, "O")