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 5d76896e69e..1e1f462cecc 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 @@ -2991,6 +2991,30 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/callableReference/kt47988.kt"); } + @Test + @TestMetadata("kt49526.kt") + public void testKt49526() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt49526.kt"); + } + + @Test + @TestMetadata("kt49526_sam.kt") + public void testKt49526_sam() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt49526_sam.kt"); + } + + @Test + @TestMetadata("kt49526a.kt") + public void testKt49526a() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt49526a.kt"); + } + + @Test + @TestMetadata("kt49526b.kt") + public void testKt49526b() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt49526b.kt"); + } + @Test @TestMetadata("kt50172.kt") public void testKt50172() throws Exception { diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java index 9fd2dc2fde4..f1da3a1fe33 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java @@ -3018,6 +3018,12 @@ public class Fir2IrTextTestGenerated extends AbstractFir2IrTextTest { runTest("compiler/testData/ir/irText/types/kt36143.kt"); } + @Test + @TestMetadata("kt49526.kt") + public void testKt49526() throws Exception { + runTest("compiler/testData/ir/irText/types/kt49526.kt"); + } + @Test @TestMetadata("localVariableOfIntersectionType.kt") public void testLocalVariableOfIntersectionType() throws Exception { diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/ReflectionReferencesGenerator.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/ReflectionReferencesGenerator.kt index 942b5373e20..950369e7dba 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/ReflectionReferencesGenerator.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/ReflectionReferencesGenerator.kt @@ -74,7 +74,10 @@ class ReflectionReferencesGenerator(statementGenerator: StatementGenerator) : St fun generateCallableReference(ktCallableReference: KtCallableReferenceExpression): IrExpression { val resolvedCall = getResolvedCall(ktCallableReference.callableReference)!! val resolvedDescriptor = resolvedCall.resultingDescriptor - val callableReferenceType = getTypeInferredByFrontendOrFail(ktCallableReference) + val callableReferenceType = + context.typeTranslator.approximateFunctionReferenceType( + getTypeInferredByFrontendOrFail(ktCallableReference) + ) val callBuilder = unwrapCallableDescriptorAndTypeArguments(resolvedCall) return when { diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/TypeTranslator.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/TypeTranslator.kt index bd2c7798dea..34214d8eee8 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/TypeTranslator.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/TypeTranslator.kt @@ -5,6 +5,7 @@ package org.jetbrains.kotlin.ir.util +import org.jetbrains.kotlin.builtins.isKFunctionType import org.jetbrains.kotlin.config.LanguageFeature import org.jetbrains.kotlin.config.LanguageVersionSettings import org.jetbrains.kotlin.descriptors.* @@ -203,6 +204,38 @@ abstract class TypeTranslator( return properlyApproximatedType } + fun approximateFunctionReferenceType(kotlinType: KotlinType): KotlinType { + // This is a hack to support intersection types in function references on JVM. + // Function reference type KFunctionN might contain intersection types in its top-level arguments. + // Intersection types in expressions and local variable declarations usually don't bother us. + // However, in case of function references type mapping affects behavior: + // resulting function reference class will have a bridge method, which will downcast its arguments to the expected types. + // This would cause ClassCastException in case of usual type approximation, + // because '{ X1 & ... & Xm }' would be approximated to 'Nothing'. + // JVM_OLD just relies on type mapping for generic argument types in such case. + if (!kotlinType.isKFunctionType) + return kotlinType + if (kotlinType !is SimpleType) + return kotlinType + if (kotlinType.arguments.none { it.type.constructor is IntersectionTypeConstructor }) + return kotlinType + val functionParameterTypes = kotlinType.arguments.subList(0, kotlinType.arguments.size - 1) + val functionReturnType = kotlinType.arguments.last() + return kotlinType.replace( + newArguments = functionParameterTypes.map { approximateFunctionReferenceParameterType(it) } + functionReturnType + ) + } + + private fun approximateFunctionReferenceParameterType(typeProjection: TypeProjection): TypeProjection { + if (typeProjection.isStarProjection) return typeProjection + val typeConstructor = typeProjection.type.constructor as? IntersectionTypeConstructor + ?: return typeProjection + // 'mapType' takes common supertype for intersection type supertypes, regardless of variance. + val newType = typeConstructor.getAlternativeType() + ?: commonSupertype(typeConstructor.supertypes) + return TypeProjectionImpl(typeProjection.projectionKind, newType) + } + private val isWithNewInference = languageVersionSettings.supportsFeature(LanguageFeature.NewInference) private fun approximateByKotlinRules(ktType: KotlinType): KotlinType = diff --git a/compiler/testData/codegen/box/callableReference/kt49526.kt b/compiler/testData/codegen/box/callableReference/kt49526.kt new file mode 100644 index 00000000000..fc80c659395 --- /dev/null +++ b/compiler/testData/codegen/box/callableReference/kt49526.kt @@ -0,0 +1,12 @@ +// IGNORE_BACKEND_FIR: JVM_IR +// FIR_STATUS: callable reference type approximation hack not implemented + +// WITH_STDLIB +// CHECK_BYTECODE_LISTING + +inline fun useRef(value: T, f: (T) -> Boolean) = f(value) + +fun box(): String { + val chars = listOf('a') + "-" + return if (useRef('a', chars::contains)) "OK" else "Failed" +} diff --git a/compiler/testData/codegen/box/callableReference/kt49526.txt b/compiler/testData/codegen/box/callableReference/kt49526.txt new file mode 100644 index 00000000000..71ef1731d17 --- /dev/null +++ b/compiler/testData/codegen/box/callableReference/kt49526.txt @@ -0,0 +1,6 @@ +@kotlin.Metadata +public final class Kt49526Kt { + // source: 'kt49526.kt' + public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String + public final static method useRef(p0: java.lang.Object, @org.jetbrains.annotations.NotNull p1: kotlin.jvm.functions.Function1): boolean +} diff --git a/compiler/testData/codegen/box/callableReference/kt49526_sam.kt b/compiler/testData/codegen/box/callableReference/kt49526_sam.kt new file mode 100644 index 00000000000..b6fc93d5466 --- /dev/null +++ b/compiler/testData/codegen/box/callableReference/kt49526_sam.kt @@ -0,0 +1,35 @@ +// IGNORE_BACKEND: JVM +// IGNORE_LIGHT_ANALYSIS + +// IGNORE_BACKEND_FIR: JVM_IR +// FIR_STATUS: LambdaConversionException: Type mismatch for lambda argument 1: class java.lang.Object is not convertible to interface I1 +// JVM_IR it this case has an approximated type 'KFun', which has a projected top-level argument. + +fun intersect(x: T, y: T): T = x + +interface I1 +interface I2 + +class C1 : I1, I2 { + override fun toString(): String = "OK" +} + +class C2 : I1, I2 + +fun T.k() = K(this) + +fun interface KFun { + fun invoke(x: T) +} + +class K(private val x: T) { + fun with(kf: KFun) { + kf.invoke(x) + } +} + +fun box(): String { + var result = "Failed" + intersect(C1(), C2()).k().with { result = it.toString() } + return result +} diff --git a/compiler/testData/codegen/box/callableReference/kt49526a.kt b/compiler/testData/codegen/box/callableReference/kt49526a.kt new file mode 100644 index 00000000000..67c36880f4b --- /dev/null +++ b/compiler/testData/codegen/box/callableReference/kt49526a.kt @@ -0,0 +1,20 @@ +// IGNORE_BACKEND_FIR: JVM_IR +// FIR_STATUS: callable reference type approximation hack not implemented + +fun id(x: T): T = x + +fun intersect(x: T, y: T): T = x + +interface I1 +interface I2 + +class C1 : I1, I2 { + override fun toString() = "OK" +} + +class C2 : I1, I2 + +fun box() = + intersect(C1(), C2()) + .let(::id) + .toString() diff --git a/compiler/testData/codegen/box/callableReference/kt49526b.kt b/compiler/testData/codegen/box/callableReference/kt49526b.kt new file mode 100644 index 00000000000..c7b38bffdd7 --- /dev/null +++ b/compiler/testData/codegen/box/callableReference/kt49526b.kt @@ -0,0 +1,12 @@ +// IGNORE_BACKEND_FIR: JVM_IR +// FIR_STATUS: callable reference type approximation hack not implemented + +// WITH_STDLIB + +inline fun useRef(value: T, f: (T) -> Boolean) = f(value) + +fun box(): String { + val chars = listOf('a') + "-" + val ref = chars::contains + return if (ref('a')) "OK" else "Failed" +} diff --git a/compiler/testData/ir/irText/types/kt49526.fir.ir.txt b/compiler/testData/ir/irText/types/kt49526.fir.ir.txt new file mode 100644 index 00000000000..983f2913d33 --- /dev/null +++ b/compiler/testData/ir/irText/types/kt49526.fir.ir.txt @@ -0,0 +1,15 @@ +FILE fqName: fileName:/kt49526.kt + FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Boolean + BLOCK_BODY + VAR name:ref type:kotlin.reflect.KFunction1 [val] + FUNCTION_REFERENCE 'public abstract fun contains (element: E of kotlin.collections.List): kotlin.Boolean [operator] declared in kotlin.collections.List' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= + $this: CALL 'public final fun plus (element: T of kotlin.collections.CollectionsKt.plus): kotlin.collections.List [operator] declared in kotlin.collections.CollectionsKt' type=kotlin.collections.List origin=PLUS + : kotlin.Comparable + $receiver: CALL 'public final fun listOf (element: T of kotlin.collections.CollectionsKt.listOf): kotlin.collections.List declared in kotlin.collections.CollectionsKt' type=kotlin.collections.List origin=null + : kotlin.Char + element: CONST Char type=kotlin.Char value='a' + element: CONST String type=kotlin.String value="-" + RETURN type=kotlin.Nothing from='public final fun test (): kotlin.Boolean declared in ' + CALL 'public abstract fun invoke (p1: P1 of kotlin.reflect.KFunction1): R of kotlin.reflect.KFunction1 [operator] declared in kotlin.reflect.KFunction1' type=kotlin.Boolean origin=INVOKE + $this: GET_VAR 'val ref: kotlin.reflect.KFunction1 [val] declared in .test' type=kotlin.reflect.KFunction1 origin=VARIABLE_AS_FUNCTION + p1: CONST Char type=kotlin.Char value='a' diff --git a/compiler/testData/ir/irText/types/kt49526.ir.txt b/compiler/testData/ir/irText/types/kt49526.ir.txt new file mode 100644 index 00000000000..18db14a9303 --- /dev/null +++ b/compiler/testData/ir/irText/types/kt49526.ir.txt @@ -0,0 +1,15 @@ +FILE fqName: fileName:/kt49526.kt + FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Boolean + BLOCK_BODY + VAR name:ref type:kotlin.reflect.KFunction1 [val] + FUNCTION_REFERENCE 'public abstract fun contains (element: E of kotlin.collections.List): kotlin.Boolean [operator] declared in kotlin.collections.List' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= + $this: CALL 'public final fun plus (element: T of kotlin.collections.CollectionsKt.plus): kotlin.collections.List [operator] declared in kotlin.collections.CollectionsKt' type=kotlin.collections.List origin=PLUS + : kotlin.Any + $receiver: CALL 'public final fun listOf (element: T of kotlin.collections.CollectionsKt.listOf): kotlin.collections.List declared in kotlin.collections.CollectionsKt' type=kotlin.collections.List origin=null + : kotlin.Char + element: CONST Char type=kotlin.Char value='a' + element: CONST String type=kotlin.String value="-" + RETURN type=kotlin.Nothing from='public final fun test (): kotlin.Boolean declared in ' + CALL 'public abstract fun invoke (p1: P1 of kotlin.reflect.KFunction1): R of kotlin.reflect.KFunction1 [fake_override,operator] declared in kotlin.reflect.KFunction1' type=kotlin.Boolean origin=INVOKE + $this: GET_VAR 'val ref: kotlin.reflect.KFunction1 [val] declared in .test' type=kotlin.reflect.KFunction1 origin=VARIABLE_AS_FUNCTION + p1: CONST Char type=kotlin.Char value='a' diff --git a/compiler/testData/ir/irText/types/kt49526.kt b/compiler/testData/ir/irText/types/kt49526.kt new file mode 100644 index 00000000000..6524a106778 --- /dev/null +++ b/compiler/testData/ir/irText/types/kt49526.kt @@ -0,0 +1,7 @@ +// WITH_STDLIB +// SKIP_KT_DUMP + +fun test(): Boolean { + val ref = (listOf('a') + "-")::contains + return ref('a') +} 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 54db22ceeb0..20b1b898239 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 @@ -2913,6 +2913,30 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/callableReference/kt47988.kt"); } + @Test + @TestMetadata("kt49526.kt") + public void testKt49526() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt49526.kt"); + } + + @Test + @TestMetadata("kt49526_sam.kt") + public void testKt49526_sam() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt49526_sam.kt"); + } + + @Test + @TestMetadata("kt49526a.kt") + public void testKt49526a() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt49526a.kt"); + } + + @Test + @TestMetadata("kt49526b.kt") + public void testKt49526b() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt49526b.kt"); + } + @Test @TestMetadata("kt50172.kt") public void testKt50172() 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 5877ea4e3a6..4027a585b10 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 @@ -2991,6 +2991,30 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/callableReference/kt47988.kt"); } + @Test + @TestMetadata("kt49526.kt") + public void testKt49526() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt49526.kt"); + } + + @Test + @TestMetadata("kt49526_sam.kt") + public void testKt49526_sam() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt49526_sam.kt"); + } + + @Test + @TestMetadata("kt49526a.kt") + public void testKt49526a() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt49526a.kt"); + } + + @Test + @TestMetadata("kt49526b.kt") + public void testKt49526b() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt49526b.kt"); + } + @Test @TestMetadata("kt50172.kt") public void testKt50172() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/IrTextTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/IrTextTestGenerated.java index ff4daa078b6..063eaff8bbd 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/IrTextTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/IrTextTestGenerated.java @@ -3018,6 +3018,12 @@ public class IrTextTestGenerated extends AbstractIrTextTest { runTest("compiler/testData/ir/irText/types/kt36143.kt"); } + @Test + @TestMetadata("kt49526.kt") + public void testKt49526() throws Exception { + runTest("compiler/testData/ir/irText/types/kt49526.kt"); + } + @Test @TestMetadata("localVariableOfIntersectionType.kt") public void testLocalVariableOfIntersectionType() 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 5e999c344be..4149f55b221 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -2425,6 +2425,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/callableReference/kt21092b.kt"); } + @TestMetadata("kt49526_sam.kt") + public void ignoreKt49526_sam() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt49526_sam.kt"); + } + private void runTest(String testDataFilePath) throws Exception { KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } @@ -2558,6 +2563,21 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/callableReference/kt47988.kt"); } + @TestMetadata("kt49526.kt") + public void testKt49526() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt49526.kt"); + } + + @TestMetadata("kt49526a.kt") + public void testKt49526a() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt49526a.kt"); + } + + @TestMetadata("kt49526b.kt") + public void testKt49526b() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt49526b.kt"); + } + @TestMetadata("kt50172.kt") public void testKt50172() throws Exception { runTest("compiler/testData/codegen/box/callableReference/kt50172.kt"); diff --git a/compiler/tests-gen/org/jetbrains/kotlin/klib/KlibTextTestCaseGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/klib/KlibTextTestCaseGenerated.java index b2e8ec3943a..0d6a235143c 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/klib/KlibTextTestCaseGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/klib/KlibTextTestCaseGenerated.java @@ -2192,6 +2192,11 @@ public class KlibTextTestCaseGenerated extends AbstractKlibTextTestCase { runTest("compiler/testData/ir/irText/types/kt36143.kt"); } + @TestMetadata("kt49526.kt") + public void testKt49526() throws Exception { + runTest("compiler/testData/ir/irText/types/kt49526.kt"); + } + @TestMetadata("localVariableOfIntersectionType.kt") public void testLocalVariableOfIntersectionType() throws Exception { runTest("compiler/testData/ir/irText/types/localVariableOfIntersectionType.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java index c3087060335..04548535667 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java @@ -1911,6 +1911,30 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/callableReference/kt47988.kt"); } + @Test + @TestMetadata("kt49526.kt") + public void testKt49526() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt49526.kt"); + } + + @Test + @TestMetadata("kt49526_sam.kt") + public void testKt49526_sam() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt49526_sam.kt"); + } + + @Test + @TestMetadata("kt49526a.kt") + public void testKt49526a() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt49526a.kt"); + } + + @Test + @TestMetadata("kt49526b.kt") + public void testKt49526b() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt49526b.kt"); + } + @Test @TestMetadata("kt50172.kt") public void testKt50172() throws Exception { diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java index 32184f576c7..07a7ecec85d 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java @@ -1953,6 +1953,30 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/callableReference/kt47988.kt"); } + @Test + @TestMetadata("kt49526.kt") + public void testKt49526() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt49526.kt"); + } + + @Test + @TestMetadata("kt49526_sam.kt") + public void testKt49526_sam() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt49526_sam.kt"); + } + + @Test + @TestMetadata("kt49526a.kt") + public void testKt49526a() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt49526a.kt"); + } + + @Test + @TestMetadata("kt49526b.kt") + public void testKt49526b() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt49526b.kt"); + } + @Test @TestMetadata("kt50172.kt") public void testKt50172() throws Exception { diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/testOld/wasm/semantics/IrCodegenBoxWasmTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/testOld/wasm/semantics/IrCodegenBoxWasmTestGenerated.java index fefcf597ec2..ef50fabe7b7 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/testOld/wasm/semantics/IrCodegenBoxWasmTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/testOld/wasm/semantics/IrCodegenBoxWasmTestGenerated.java @@ -1748,6 +1748,26 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest runTest("compiler/testData/codegen/box/callableReference/kt47988.kt"); } + @TestMetadata("kt49526.kt") + public void testKt49526() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt49526.kt"); + } + + @TestMetadata("kt49526_sam.kt") + public void testKt49526_sam() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt49526_sam.kt"); + } + + @TestMetadata("kt49526a.kt") + public void testKt49526a() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt49526a.kt"); + } + + @TestMetadata("kt49526b.kt") + public void testKt49526b() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt49526b.kt"); + } + @TestMetadata("kt50172.kt") public void testKt50172() throws Exception { runTest("compiler/testData/codegen/box/callableReference/kt50172.kt"); diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeExtBlackBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeExtBlackBoxTestGenerated.java index fd7a4afbf3e..d9931a658e2 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeExtBlackBoxTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeExtBlackBoxTestGenerated.java @@ -1978,6 +1978,30 @@ public class NativeExtBlackBoxTestGenerated extends AbstractNativeBlackBoxTest { runTest("compiler/testData/codegen/box/callableReference/kt47988.kt"); } + @Test + @TestMetadata("kt49526.kt") + public void testKt49526() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt49526.kt"); + } + + @Test + @TestMetadata("kt49526_sam.kt") + public void testKt49526_sam() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt49526_sam.kt"); + } + + @Test + @TestMetadata("kt49526a.kt") + public void testKt49526a() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt49526a.kt"); + } + + @Test + @TestMetadata("kt49526b.kt") + public void testKt49526b() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt49526b.kt"); + } + @Test @TestMetadata("kt50172.kt") public void testKt50172() throws Exception {