From b0aefd543a73146e7b591fa705ae362dbb638d57 Mon Sep 17 00:00:00 2001 From: Ilya Goncharov Date: Mon, 11 Oct 2021 09:02:08 +0000 Subject: [PATCH] [JS IR] Fix offsets and add new test [JS IR] Use TypeSubstitutor for full substitution of types - adding new tests [JS IR] Commonize context and use in wasm [JS IR] Add test with receiver with callable reference [JS IR] Add prerequisites around inlining and callable references [JS IR] Review fixes - Add test with bounded type parameter - Remove redundant casts - Use offsets for synth function - Correct traversing [JS IR] Not use origin for not inlined function reference [JS IR] Move util into common place [JS IR] Fix offsets [JS IR] Add type parameter argument and using value in test [JS IR] Wrap inlined callable references with reified parameters [JS IR] Add test on callable reference inlined fun Merge-request: KT-MR-4722 --- .../FirBlackBoxCodegenTestGenerated.java | 6 + .../kotlin/ir/backend/js/JsLoweringPhases.kt | 17 ++- ...ationsWithReifiedTypeParametersLowering.kt | 3 +- ...ationsWithReifiedTypeParametersLowering.kt | 107 ++++++++++++++++++ .../kotlin/ir/backend/js/utils/misc.kt | 4 +- .../kotlin/backend/wasm/WasmLoweringPhases.kt | 13 ++- .../reified/callableReferenceInlinedFun.kt | 90 +++++++++++++++ .../codegen/BlackBoxCodegenTestGenerated.java | 6 + .../IrBlackBoxCodegenTestGenerated.java | 6 + .../LightAnalysisModeTestGenerated.java | 5 + .../IrJsCodegenBoxES6TestGenerated.java | 5 + .../IrJsCodegenBoxTestGenerated.java | 5 + .../semantics/JsCodegenBoxTestGenerated.java | 5 + .../IrCodegenBoxWasmTestGenerated.java | 5 + 14 files changed, 267 insertions(+), 10 deletions(-) create mode 100644 compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/inline/WrapInlineDeclarationsWithReifiedTypeParametersLowering.kt create mode 100644 compiler/testData/codegen/box/reified/callableReferenceInlinedFun.kt diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java index da87a932389..3a0b0776907 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java @@ -39652,6 +39652,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/reified/asOnPlatformType.kt"); } + @Test + @TestMetadata("callableReferenceInlinedFun.kt") + public void testCallableReferenceInlinedFun() throws Exception { + runTest("compiler/testData/codegen/box/reified/callableReferenceInlinedFun.kt"); + } + @Test @TestMetadata("checkcast.kt") public void testCheckcast() throws Exception { diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsLoweringPhases.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsLoweringPhases.kt index 99de50fc8f5..b8f86096448 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsLoweringPhases.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsLoweringPhases.kt @@ -21,10 +21,7 @@ import org.jetbrains.kotlin.ir.backend.js.lower.calls.CallsLowering import org.jetbrains.kotlin.ir.backend.js.lower.cleanup.CleanupLowering import org.jetbrains.kotlin.ir.backend.js.lower.coroutines.JsSuspendArityStoreLowering import org.jetbrains.kotlin.ir.backend.js.lower.coroutines.JsSuspendFunctionsLowering -import org.jetbrains.kotlin.ir.backend.js.lower.inline.CopyInlineFunctionBodyLowering -import org.jetbrains.kotlin.ir.backend.js.lower.inline.RemoveInlineDeclarationsWithReifiedTypeParametersLowering -import org.jetbrains.kotlin.ir.backend.js.lower.inline.SyntheticAccessorLowering -import org.jetbrains.kotlin.ir.backend.js.lower.inline.jsRecordExtractedLocalClasses +import org.jetbrains.kotlin.ir.backend.js.lower.inline.* import org.jetbrains.kotlin.ir.declarations.IrFile import org.jetbrains.kotlin.ir.declarations.IrModuleFragment @@ -245,6 +242,12 @@ private val syntheticAccessorLoweringPhase = makeBodyLoweringPhase( description = "Wrap top level inline function to access through them from inline functions" ) +private val wrapInlineDeclarationsWithReifiedTypeParametersLowering = makeBodyLoweringPhase( + ::WrapInlineDeclarationsWithReifiedTypeParametersLowering, + name = "WrapInlineDeclarationsWithReifiedTypeParametersLowering", + description = "Wrap inline declarations with reified type parameters" +) + private val functionInliningPhase = makeBodyLoweringPhase( ::FunctionInlining, name = "FunctionInliningPhase", @@ -252,7 +255,7 @@ private val functionInliningPhase = makeBodyLoweringPhase( prerequisite = setOf( expectDeclarationsRemovingPhase, sharedVariablesLoweringPhase, localClassesInInlineLambdasPhase, localClassesExtractionFromInlineFunctionsPhase, - syntheticAccessorLoweringPhase + syntheticAccessorLoweringPhase, wrapInlineDeclarationsWithReifiedTypeParametersLowering ) ) @@ -359,7 +362,8 @@ private val enumEntryRemovalLoweringPhase = makeDeclarationTransformerPhase( private val callableReferenceLowering = makeBodyLoweringPhase( ::CallableReferenceLowering, name = "CallableReferenceLowering", - description = "Build a lambda/callable reference class" + description = "Build a lambda/callable reference class", + prerequisite = setOf(functionInliningPhase, wrapInlineDeclarationsWithReifiedTypeParametersLowering) ) private val returnableBlockLoweringPhase = makeBodyLoweringPhase( @@ -767,6 +771,7 @@ private val loweringList = listOf( localClassesInInlineFunctionsPhase, localClassesExtractionFromInlineFunctionsPhase, syntheticAccessorLoweringPhase, + wrapInlineDeclarationsWithReifiedTypeParametersLowering, functionInliningPhase, copyInlineFunctionBodyLoweringPhase, removeInlineDeclarationsWithReifiedTypeParametersLoweringPhase, diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/inline/RemoveInlineDeclarationsWithReifiedTypeParametersLowering.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/inline/RemoveInlineDeclarationsWithReifiedTypeParametersLowering.kt index 043f1fd8d93..a97d436580e 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/inline/RemoveInlineDeclarationsWithReifiedTypeParametersLowering.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/inline/RemoveInlineDeclarationsWithReifiedTypeParametersLowering.kt @@ -7,6 +7,7 @@ package org.jetbrains.kotlin.ir.backend.js.lower.inline import org.jetbrains.kotlin.backend.common.DeclarationTransformer import org.jetbrains.kotlin.ir.backend.js.JsIrBackendContext +import org.jetbrains.kotlin.ir.backend.js.utils.isInlineFunWithReifiedParameter import org.jetbrains.kotlin.ir.declarations.IrDeclaration import org.jetbrains.kotlin.ir.declarations.IrFunction import org.jetbrains.kotlin.ir.declarations.IrProperty @@ -17,8 +18,6 @@ import org.jetbrains.kotlin.ir.util.deepCopyWithSymbols class RemoveInlineDeclarationsWithReifiedTypeParametersLowering: DeclarationTransformer { override fun transformFlat(declaration: IrDeclaration): List? { - fun IrFunction.isInlineFunWithReifiedParameter() = isInline && typeParameters.any { it.isReified } - if (declaration is IrFunction && declaration.isInlineFunWithReifiedParameter() || declaration is IrProperty && declaration.getter?.isInlineFunWithReifiedParameter() == true ) { diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/inline/WrapInlineDeclarationsWithReifiedTypeParametersLowering.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/inline/WrapInlineDeclarationsWithReifiedTypeParametersLowering.kt new file mode 100644 index 00000000000..d67a4e890fb --- /dev/null +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/inline/WrapInlineDeclarationsWithReifiedTypeParametersLowering.kt @@ -0,0 +1,107 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.ir.backend.js.lower.inline + +import org.jetbrains.kotlin.backend.common.BackendContext +import org.jetbrains.kotlin.backend.common.BodyLoweringPass +import org.jetbrains.kotlin.descriptors.DescriptorVisibilities +import org.jetbrains.kotlin.ir.backend.js.ir.JsIrBuilder +import org.jetbrains.kotlin.ir.backend.js.utils.isInlineFunWithReifiedParameter +import org.jetbrains.kotlin.ir.builders.declarations.addFunction +import org.jetbrains.kotlin.ir.builders.declarations.addValueParameter +import org.jetbrains.kotlin.ir.declarations.IrDeclaration +import org.jetbrains.kotlin.ir.declarations.IrDeclarationContainer +import org.jetbrains.kotlin.ir.declarations.IrSimpleFunction +import org.jetbrains.kotlin.ir.expressions.IrBody +import org.jetbrains.kotlin.ir.expressions.IrExpression +import org.jetbrains.kotlin.ir.expressions.IrFunctionReference +import org.jetbrains.kotlin.ir.expressions.impl.IrFunctionReferenceImpl +import org.jetbrains.kotlin.ir.types.IrTypeArgument +import org.jetbrains.kotlin.ir.types.IrTypeSubstitutor +import org.jetbrains.kotlin.ir.util.typeSubstitutionMap +import org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid +import org.jetbrains.kotlin.ir.visitors.transformChildrenVoid +import org.jetbrains.kotlin.name.Name + +// Replace callable reference on inline function with reified parameter +// with callable reference on new non inline function with substituted types +class WrapInlineDeclarationsWithReifiedTypeParametersLowering(val context: BackendContext) : BodyLoweringPass { + private val irFactory + get() = context.irFactory + + override fun lower(irBody: IrBody, container: IrDeclaration) { + irBody.transformChildrenVoid(object : IrElementTransformerVoid() { + override fun visitFunctionReference(expression: IrFunctionReference): IrExpression { + expression.transformChildrenVoid() + + val owner = expression.symbol.owner as? IrSimpleFunction + ?: return expression + + if (!owner.isInlineFunWithReifiedParameter()) { + return expression + } + val substitutionMap = expression.typeSubstitutionMap + .entries + .map { (key, value) -> + key to (value as IrTypeArgument) + } + val typeSubstitutor = IrTypeSubstitutor( + substitutionMap.map { it.first }, + substitutionMap.map { it.second }, + context.irBuiltIns + ) + + val function = irFactory.addFunction(container.parent as IrDeclarationContainer) { + name = Name.identifier("${owner.name}${"$"}wrap") + returnType = owner.returnType + visibility = DescriptorVisibilities.PRIVATE + origin = JsIrBuilder.SYNTHESIZED_DECLARATION + }.also { function -> + owner.valueParameters.forEach { valueParameter -> + function.addValueParameter( + valueParameter.name, + typeSubstitutor.substitute(valueParameter.type) + ) + } + function.body = irFactory.createBlockBody( + expression.startOffset, + expression.endOffset + ) { + statements.add( + JsIrBuilder.buildReturn( + function.symbol, + JsIrBuilder.buildCall(owner.symbol).also { call -> + call.dispatchReceiver = expression.dispatchReceiver + call.extensionReceiver = expression.extensionReceiver + function.valueParameters.forEachIndexed { index, valueParameter -> + call.putValueArgument(index, JsIrBuilder.buildGetValue(valueParameter.symbol)) + } + for (i in 0 until expression.typeArgumentsCount) { + call.putTypeArgument(i, expression.getTypeArgument(i)) + } + }, + owner.returnType + ) + ) + } + } + return IrFunctionReferenceImpl.fromSymbolOwner( + expression.startOffset, + expression.endOffset, + expression.type, + function.symbol, + function.typeParameters.size, + expression.reflectionTarget + ) + } + }) + } +} \ No newline at end of file diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/misc.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/misc.kt index 737e6e4890a..793da41b988 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/misc.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/misc.kt @@ -129,4 +129,6 @@ fun invokeFunForLambda(call: IrCall) = .getClass()!! .declarations .filterIsInstance() - .single { it.name.asString() == "invoke" } \ No newline at end of file + .single { it.name.asString() == "invoke" } + +fun IrFunction.isInlineFunWithReifiedParameter() = isInline && typeParameters.any { it.isReified } \ No newline at end of file diff --git a/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/WasmLoweringPhases.kt b/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/WasmLoweringPhases.kt index d885d65986e..7bf0212e2de 100644 --- a/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/WasmLoweringPhases.kt +++ b/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/WasmLoweringPhases.kt @@ -14,6 +14,7 @@ import org.jetbrains.kotlin.backend.common.phaser.* import org.jetbrains.kotlin.backend.wasm.lower.* import org.jetbrains.kotlin.ir.backend.js.lower.* import org.jetbrains.kotlin.ir.backend.js.lower.inline.RemoveInlineDeclarationsWithReifiedTypeParametersLowering +import org.jetbrains.kotlin.ir.backend.js.lower.inline.WrapInlineDeclarationsWithReifiedTypeParametersLowering import org.jetbrains.kotlin.ir.declarations.IrModuleFragment import org.jetbrains.kotlin.ir.util.patchDeclarationParents @@ -87,6 +88,12 @@ private val provisionalFunctionExpressionPhase = makeWasmModulePhase( description = "Transform IrFunctionExpression to a local function reference" ) +private val wrapInlineDeclarationsWithReifiedTypeParametersPhase = makeWasmModulePhase( + ::WrapInlineDeclarationsWithReifiedTypeParametersLowering, + name = "WrapInlineDeclarationsWithReifiedTypeParametersPhase", + description = "Wrap inline declarations with reified type parameters" +) + private val functionInliningPhase = makeCustomWasmModulePhase( { context, module -> FunctionInlining(context).inline(module) @@ -94,7 +101,10 @@ private val functionInliningPhase = makeCustomWasmModulePhase( }, name = "FunctionInliningPhase", description = "Perform function inlining", - prerequisite = setOf(expectDeclarationsRemovingPhase) + prerequisite = setOf( + expectDeclarationsRemovingPhase, + wrapInlineDeclarationsWithReifiedTypeParametersPhase + ) ) private val removeInlineDeclarationsWithReifiedTypeParametersLoweringPhase = makeWasmModulePhase( @@ -448,6 +458,7 @@ val wasmPhases = NamedCompilerPhase( // TODO: Need some helpers from stdlib // arrayConstructorPhase then + wrapInlineDeclarationsWithReifiedTypeParametersPhase then functionInliningPhase then provisionalFunctionExpressionPhase then diff --git a/compiler/testData/codegen/box/reified/callableReferenceInlinedFun.kt b/compiler/testData/codegen/box/reified/callableReferenceInlinedFun.kt new file mode 100644 index 00000000000..5f17b80c7cb --- /dev/null +++ b/compiler/testData/codegen/box/reified/callableReferenceInlinedFun.kt @@ -0,0 +1,90 @@ +// WITH_RUNTIME + +inline fun baz(value: T): String = "OK" + value + +fun test(): String { + val f: (Any) -> String = ::baz + return f(1) +} + +object Foo { + val log = "123" +} + +public inline fun Foo.foo(value: T): String = + log + value + +val test2 = { "OK".let(Foo::foo) } + +object Bar { + val log = "321" + + public inline fun bar(value: T): String = + log + value +} + +val test3 = { "OK".let(Bar::bar) } + +class C { + inline fun qux(value: T): String = "OK" + value +} + +fun test4(): String { + val c = C() + val cr: (String) -> String = c::qux + return cr("456") +} + +inline fun ((Any) -> String).cux(value: T): String = this(value) + +fun test5(): String { + val foo: (Any) -> String = ({ b: Any -> + val a: (Any) -> String = ::baz + a(b) + })::cux + return foo(3) +} + +inline fun bak(value1: T, value2: K, value3: S): String = "OK" + value1 + value2 + value3 + +fun test6(): String { + val f: (Any, Int, String) -> String = ::bak + return f(1, 37, "joo") +} + +inline fun bal(value1: Array, value2: Array): String = "OK" + value1.joinToString() + value2.joinToString() + +fun test7(): String { + val f: (Array, Array) -> String = ::bal + return f(arrayOf("mer", "nas"), arrayOf(73, 37)) +} + +class E +public inline fun E.foo(value: T): String = "OK" + value + +class F { + inline fun foo(x: T1, y: T2): Any? = "OK" + x + y +} + +fun box(): String { + val test1 = test() + if (test1 != "OK1") return "fail1: $test1" + val test2 = test2() + if (test2 != "123OK") return "fail2: $test2" + val test3 = test3() + if (test3 != "321OK") return "fail3: $test3" + val test4 = test4() + if (test4 != "OK456") return "fail4: $test4" + val test5 = test5() + if (test5 != "OK3") return "fail5: $test5" + val test6 = test6() + if (test6 != "OK137joo") return "fail6: $test6" + val test7 = test7() + if (test7 != "OKmer, nas73, 37") return "fail7: $test7" + val test8 = E().foo(56) + if (test8 != "OK56") return "fail8: $test8" + val test9 = F().foo(65, "hello") + if (test9 != "OK65hello") return "fail9: $test9" + + return "OK" +} diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index 34891818fc7..e38618b4a41 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -39490,6 +39490,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/reified/asOnPlatformType.kt"); } + @Test + @TestMetadata("callableReferenceInlinedFun.kt") + public void testCallableReferenceInlinedFun() throws Exception { + runTest("compiler/testData/codegen/box/reified/callableReferenceInlinedFun.kt"); + } + @Test @TestMetadata("checkcast.kt") public void testCheckcast() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index ea38cb681ac..5e0c0b463a0 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -39652,6 +39652,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/reified/asOnPlatformType.kt"); } + @Test + @TestMetadata("callableReferenceInlinedFun.kt") + public void testCallableReferenceInlinedFun() throws Exception { + runTest("compiler/testData/codegen/box/reified/callableReferenceInlinedFun.kt"); + } + @Test @TestMetadata("checkcast.kt") public void testCheckcast() throws Exception { diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 6b2f9c99316..8d4101fe31d 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -31600,6 +31600,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/reified/asOnPlatformType.kt"); } + @TestMetadata("callableReferenceInlinedFun.kt") + public void testCallableReferenceInlinedFun() throws Exception { + runTest("compiler/testData/codegen/box/reified/callableReferenceInlinedFun.kt"); + } + @TestMetadata("checkcast.kt") public void testCheckcast() throws Exception { runTest("compiler/testData/codegen/box/reified/checkcast.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java index 53565c75278..99b87203de6 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java @@ -26820,6 +26820,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/reified"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); } + @TestMetadata("callableReferenceInlinedFun.kt") + public void testCallableReferenceInlinedFun() throws Exception { + runTest("compiler/testData/codegen/box/reified/callableReferenceInlinedFun.kt"); + } + @TestMetadata("checkcast.kt") public void testCheckcast() throws Exception { runTest("compiler/testData/codegen/box/reified/checkcast.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java index 679c6001328..3321dd18736 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java @@ -26226,6 +26226,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/reified"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); } + @TestMetadata("callableReferenceInlinedFun.kt") + public void testCallableReferenceInlinedFun() throws Exception { + runTest("compiler/testData/codegen/box/reified/callableReferenceInlinedFun.kt"); + } + @TestMetadata("checkcast.kt") public void testCheckcast() throws Exception { runTest("compiler/testData/codegen/box/reified/checkcast.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index 9df46e7c55e..89b7509d1a5 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -26136,6 +26136,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/reified"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true); } + @TestMetadata("callableReferenceInlinedFun.kt") + public void testCallableReferenceInlinedFun() throws Exception { + runTest("compiler/testData/codegen/box/reified/callableReferenceInlinedFun.kt"); + } + @TestMetadata("checkcast.kt") public void testCheckcast() throws Exception { runTest("compiler/testData/codegen/box/reified/checkcast.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java index 6af89a38cfd..45508602005 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java @@ -20060,6 +20060,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/reified"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true); } + @TestMetadata("callableReferenceInlinedFun.kt") + public void testCallableReferenceInlinedFun() throws Exception { + runTest("compiler/testData/codegen/box/reified/callableReferenceInlinedFun.kt"); + } + @TestMetadata("checkcast.kt") public void testCheckcast() throws Exception { runTest("compiler/testData/codegen/box/reified/checkcast.kt");