From 670f029bdf218a7f9910d613180652725236ac64 Mon Sep 17 00:00:00 2001 From: Victor Petukhov Date: Tue, 19 Jan 2021 12:11:09 +0300 Subject: [PATCH] Allow passing non-spread arrays into a vararg parameter after sam properly, through propagating vararg element type to a sam adapter from the original parameter descriptor --- .../FirBlackBoxCodegenTestGenerated.java | 6 --- .../sam/JavaSingleAbstractMethodUtils.java | 29 ++++++++--- .../kotlin/synthetic/JavaSyntheticScopes.kt | 4 +- .../synthetic/SamAdapterFunctionsScope.kt | 50 +++++++++---------- .../calls/components/SamTypeConversions.kt | 5 +- ...rgumentWithoutSamConversionsPerArgument.kt | 41 --------------- .../arrayAsVarargAfterSamArgument.fir.kt | 18 +++---- .../arrayAsVarargAfterSamArgument.kt | 18 +++---- ...yAsVarargAfterSamArgumentProhibited.fir.kt | 2 +- ...arrayAsVarargAfterSamArgumentProhibited.kt | 2 +- ...entWithoutSamConversionsPerArgument.fir.kt | 2 +- ...rgumentWithoutSamConversionsPerArgument.kt | 2 +- .../codegen/BlackBoxCodegenTestGenerated.java | 6 --- .../IrBlackBoxCodegenTestGenerated.java | 6 --- .../LightAnalysisModeTestGenerated.java | 5 -- 15 files changed, 70 insertions(+), 126 deletions(-) delete mode 100644 compiler/testData/codegen/box/sam/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.kt diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java index 104d6713b71..7b8f5c62c04 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java @@ -34236,12 +34236,6 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/sam/arrayAsVarargAfterSamArgument.kt"); } - @Test - @TestMetadata("arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.kt") - public void testArrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument() throws Exception { - runTest("compiler/testData/codegen/box/sam/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.kt"); - } - @Test @TestMetadata("castFromAny.kt") public void testCastFromAny() throws Exception { diff --git a/compiler/frontend.java/src/org/jetbrains/kotlin/load/java/sam/JavaSingleAbstractMethodUtils.java b/compiler/frontend.java/src/org/jetbrains/kotlin/load/java/sam/JavaSingleAbstractMethodUtils.java index e1104e87ae5..a5c1fe7bb9b 100644 --- a/compiler/frontend.java/src/org/jetbrains/kotlin/load/java/sam/JavaSingleAbstractMethodUtils.java +++ b/compiler/frontend.java/src/org/jetbrains/kotlin/load/java/sam/JavaSingleAbstractMethodUtils.java @@ -63,7 +63,8 @@ public class JavaSingleAbstractMethodUtils { public static SamAdapterDescriptor createSamAdapterFunction( @NotNull JavaMethodDescriptor original, @NotNull SamConversionResolver samResolver, - @NotNull SamConversionOracle samConversionOracle + @NotNull SamConversionOracle samConversionOracle, + boolean allowNonSpreadArraysForVarargAfterSam ) { SamAdapterFunctionDescriptor result = new SamAdapterFunctionDescriptor(original); return initSamAdapter(original, result, new FunctionInitializer() { @@ -83,14 +84,15 @@ public class JavaSingleAbstractMethodUtils { original.getVisibility() ); } - }, samResolver, samConversionOracle); + }, samResolver, samConversionOracle, allowNonSpreadArraysForVarargAfterSam); } @NotNull public static SamAdapterDescriptor createSamAdapterConstructor( @NotNull JavaClassConstructorDescriptor original, @NotNull SamConversionResolver samResolver, - @NotNull SamConversionOracle samConversionOracle + @NotNull SamConversionOracle samConversionOracle, + boolean allowNonSpreadArraysForVarargAfterSam ) { SamAdapterClassConstructorDescriptor result = new SamAdapterClassConstructorDescriptor(original); return initSamAdapter(original, result, new FunctionInitializer() { @@ -103,7 +105,7 @@ public class JavaSingleAbstractMethodUtils { result.initialize(valueParameters, original.getVisibility()); result.setReturnType(returnType); } - }, samResolver, samConversionOracle); + }, samResolver, samConversionOracle, allowNonSpreadArraysForVarargAfterSam); } @NotNull @@ -112,7 +114,8 @@ public class JavaSingleAbstractMethodUtils { @NotNull SamAdapterDescriptor adapter, @NotNull FunctionInitializer initializer, @NotNull SamConversionResolver samResolver, - @NotNull SamConversionOracle samConversionOracle + @NotNull SamConversionOracle samConversionOracle, + boolean allowNonSpreadArraysForVarargAfterSam ) { SamConstructorTypeParameters typeParameters; if (adapter instanceof SamAdapterClassConstructorDescriptor) { @@ -131,7 +134,7 @@ public class JavaSingleAbstractMethodUtils { List valueParameters = - createValueParametersForSamAdapter(original, adapter, substitutor, samResolver, samConversionOracle); + createValueParametersForSamAdapter(original, adapter, substitutor, samResolver, samConversionOracle, allowNonSpreadArraysForVarargAfterSam); initializer.initialize(typeParameters.getDescriptors(), valueParameters, returnType); @@ -143,7 +146,8 @@ public class JavaSingleAbstractMethodUtils { @NotNull FunctionDescriptor samAdapter, @NotNull TypeSubstitutor substitutor, @NotNull SamConversionResolver samResolver, - @NotNull SamConversionOracle samConversionOracle + @NotNull SamConversionOracle samConversionOracle, + boolean allowNonSpreadArraysForVarargAfterSam ) { List originalValueParameters = original.getValueParameters(); List valueParameters = new ArrayList<>(originalValueParameters.size()); @@ -154,13 +158,22 @@ public class JavaSingleAbstractMethodUtils { KotlinType newType = substitutor.substitute(newTypeUnsubstituted, Variance.IN_VARIANCE); assert newType != null : "couldn't substitute type: " + newTypeUnsubstituted + ", substitutor = " + substitutor; + /* + * Before 1.5 we allowed passing non-spread arrays into vararg parameter, after sam conversion like: + * public static String foo1(Runnable r, String... strs) { } + * ... + * Test.foo1({}, arrayOf()) + * For that, we don't pass `varargElementType` from the original parameter descriptor. + */ + KotlinType varargElementType = allowNonSpreadArraysForVarargAfterSam ? null : originalParam.getVarargElementType(); + ValueParameterDescriptor newParam = new ValueParameterDescriptorImpl( samAdapter, null, originalParam.getIndex(), originalParam.getAnnotations(), originalParam.getName(), newType, /* declaresDefaultValue = */ false, /* isCrossinline = */ false, /* isNoinline = */ false, - null, SourceElement.NO_SOURCE + varargElementType, SourceElement.NO_SOURCE ); valueParameters.add(newParam); } diff --git a/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/JavaSyntheticScopes.kt b/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/JavaSyntheticScopes.kt index f22925b77c1..cf22491e400 100644 --- a/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/JavaSyntheticScopes.kt +++ b/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/JavaSyntheticScopes.kt @@ -69,7 +69,7 @@ class JavaSyntheticScopes( deprecationResolver, lookupTracker, samViaSyntheticScopeDisabled = samConversionPerArgumentIsEnabled, - shouldGenerateCandidateForVarargAfterSam = !languageVersionSettings.supportsFeature( + allowNonSpreadArraysForVarargAfterSam = !languageVersionSettings.supportsFeature( LanguageFeature.ProhibitVarargAsArrayAfterSamArgument ) ) @@ -87,7 +87,7 @@ class JavaSyntheticScopes( deprecationResolver, lookupTracker, samViaSyntheticScopeDisabled = false, - shouldGenerateCandidateForVarargAfterSam = false + allowNonSpreadArraysForVarargAfterSam = false ) scopesWithForceEnabledSamAdapters = diff --git a/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/SamAdapterFunctionsScope.kt b/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/SamAdapterFunctionsScope.kt index dea3e03870f..64695784db1 100644 --- a/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/SamAdapterFunctionsScope.kt +++ b/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/SamAdapterFunctionsScope.kt @@ -59,10 +59,8 @@ class SamAdapterFunctionsScope( private val deprecationResolver: DeprecationResolver, private val lookupTracker: LookupTracker, private val samViaSyntheticScopeDisabled: Boolean, - private val shouldGenerateCandidateForVarargAfterSam: Boolean + private val allowNonSpreadArraysForVarargAfterSam: Boolean ) : SyntheticScope.Default() { - private val shouldGenerateAdditionalSamCandidate = !samViaSyntheticScopeDisabled || shouldGenerateCandidateForVarargAfterSam - private val extensionForFunction = storageManager.createMemoizedFunctionWithNullableValues { function -> extensionForFunctionNotCached(function) @@ -70,8 +68,12 @@ class SamAdapterFunctionsScope( private val samAdapterForStaticFunction = storageManager.createMemoizedFunction> { function -> - JavaSingleAbstractMethodUtils - .createSamAdapterFunction(function, samResolver, samConversionOracle) + JavaSingleAbstractMethodUtils.createSamAdapterFunction( + function, + samResolver, + samConversionOracle, + allowNonSpreadArraysForVarargAfterSam + ) } private val samConstructorForClassifier = @@ -81,8 +83,12 @@ class SamAdapterFunctionsScope( private val samConstructorForJavaConstructor = storageManager.createMemoizedFunction { constructor -> - JavaSingleAbstractMethodUtils - .createSamAdapterConstructor(constructor, samResolver, samConversionOracle) as ClassConstructorDescriptor + JavaSingleAbstractMethodUtils.createSamAdapterConstructor( + constructor, + samResolver, + samConversionOracle, + allowNonSpreadArraysForVarargAfterSam + ) as ClassConstructorDescriptor } private val samConstructorForTypeAliasConstructor = @@ -96,7 +102,12 @@ class SamAdapterFunctionsScope( if (!JavaSingleAbstractMethodUtils.isSamAdapterNecessary(function)) return null if (function.returnType == null) return null if (deprecationResolver.isHiddenInResolution(function)) return null - return SamAdapterExtensionFunctionDescriptorImpl.create(function, samResolver, samConversionOracle) + return SamAdapterExtensionFunctionDescriptorImpl.create( + function, + samResolver, + samConversionOracle, + allowNonSpreadArraysForVarargAfterSam + ) } override fun getSyntheticMemberFunctions( @@ -104,8 +115,6 @@ class SamAdapterFunctionsScope( name: Name, location: LookupLocation ): Collection { - if (!shouldGenerateAdditionalSamCandidate) return emptyList() - var result: SmartList? = null for (type in receiverTypes) { for (function in type.memberScope.getContributedFunctions(name, location)) { @@ -143,7 +152,7 @@ class SamAdapterFunctionsScope( } private val FunctionDescriptor.shouldGenerateCandidateForVarargAfterSamAndHasVararg - get() = shouldGenerateCandidateForVarargAfterSam && valueParameters.lastOrNull()?.isVararg == true + get() = allowNonSpreadArraysForVarargAfterSam && valueParameters.lastOrNull()?.isVararg == true private val FunctionDescriptor.hasNothingTypeInParameters get() = valueParameters.any { it.type.isNothing() && !it.original.type.isNothing() } @@ -161,8 +170,6 @@ class SamAdapterFunctionsScope( } override fun getSyntheticMemberFunctions(receiverTypes: Collection): Collection { - if (!shouldGenerateAdditionalSamCandidate) return emptyList() - return receiverTypes.flatMapTo(LinkedHashSet()) { type -> type.memberScope.getContributedDescriptors(DescriptorKindFilter.FUNCTIONS) .filterIsInstance() @@ -179,8 +186,6 @@ class SamAdapterFunctionsScope( contributedFunctions: Collection, location: LookupLocation ): Collection { - if (!shouldGenerateAdditionalSamCandidate) return emptyList() - return getSamFunctions(contributedFunctions, location) } @@ -190,8 +195,6 @@ class SamAdapterFunctionsScope( ): Collection { recordSamLookupsToClassifier(contributedClassifier, location) - if (!shouldGenerateAdditionalSamCandidate) return listOfNotNull(getSamConstructor(contributedClassifier)) - return getAllSamConstructors(contributedClassifier) } @@ -204,16 +207,12 @@ class SamAdapterFunctionsScope( } override fun getSyntheticStaticFunctions(functionDescriptors: Collection): Collection { - if (!shouldGenerateAdditionalSamCandidate) return emptyList() - return getSamFunctions(functionDescriptors, location = null) } override fun getSyntheticConstructors(classifierDescriptors: Collection): Collection { val classifiers = classifierDescriptors.filterIsInstance() - if (!shouldGenerateAdditionalSamCandidate) return classifiers.mapNotNull { getSamConstructor(it) } - return classifiers.flatMap { getAllSamConstructors(it) } } @@ -242,8 +241,6 @@ class SamAdapterFunctionsScope( functions: Collection, location: LookupLocation? ): List> { - if (!shouldGenerateAdditionalSamCandidate) return emptyList() - return functions.mapNotNull { function -> if (function !is JavaMethodDescriptor) return@mapNotNull null if (function.dispatchReceiverParameter != null) return@mapNotNull null // consider only statics @@ -263,7 +260,7 @@ class SamAdapterFunctionsScope( } private fun getSamAdaptersFromConstructors(classifier: ClassifierDescriptor): MutableList { - if (!shouldGenerateAdditionalSamCandidate || classifier !is JavaClassDescriptor) return SmartList() + if (classifier !is JavaClassDescriptor) return SmartList() return SmartList().apply { for (constructor in classifier.constructors) { @@ -313,7 +310,8 @@ class SamAdapterFunctionsScope( fun create( sourceFunction: FunctionDescriptor, samResolver: SamConversionResolver, - samConversionOracle: SamConversionOracle + samConversionOracle: SamConversionOracle, + allowNonSpreadArraysForVarargAfterSam: Boolean ): SamAdapterExtensionFunctionDescriptorImpl { val descriptor = SamAdapterExtensionFunctionDescriptorImpl( sourceFunction.containingDeclaration, @@ -334,7 +332,7 @@ class SamAdapterFunctionsScope( val returnType = typeSubstitutor.safeSubstitute(sourceFunction.returnType!!, Variance.INVARIANT) val valueParameters = JavaSingleAbstractMethodUtils.createValueParametersForSamAdapter( - sourceFunction, descriptor, typeSubstitutor, samResolver, samConversionOracle + sourceFunction, descriptor, typeSubstitutor, samResolver, samConversionOracle, allowNonSpreadArraysForVarargAfterSam ) val visibility = syntheticVisibility(sourceFunction, isUsedForExtension = false) diff --git a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/SamTypeConversions.kt b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/SamTypeConversions.kt index b67663d9f15..ce7ac60415e 100644 --- a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/SamTypeConversions.kt +++ b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/SamTypeConversions.kt @@ -24,11 +24,8 @@ object SamTypeConversions : ParameterTypeConversion { expectedParameterType: UnwrappedType ): Boolean { val callComponents = candidate.callComponents - val generatingAdditionalSamCandidateIsEnabled = - !callComponents.languageVersionSettings.supportsFeature(LanguageFeature.SamConversionPerArgument) && - !callComponents.languageVersionSettings.supportsFeature(LanguageFeature.ProhibitVarargAsArrayAfterSamArgument) - if (generatingAdditionalSamCandidateIsEnabled) return true + if (!callComponents.languageVersionSettings.supportsFeature(LanguageFeature.SamConversionPerArgument)) return true if (expectedParameterType.isNothing()) return true if (expectedParameterType.isFunctionType) return true diff --git a/compiler/testData/codegen/box/sam/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.kt b/compiler/testData/codegen/box/sam/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.kt deleted file mode 100644 index 7d62833348a..00000000000 --- a/compiler/testData/codegen/box/sam/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.kt +++ /dev/null @@ -1,41 +0,0 @@ -// !LANGUAGE: +NewInference +SamConversionForKotlinFunctions -SamConversionPerArgument -// IGNORE_BACKEND_FIR: JVM_IR -// TARGET_BACKEND: JVM - -// FILE: Test.java -public class Test { - public static String foo1(Runnable r, String... strs) { - return null; - } - public String foo2(Runnable r1, Runnable r2, String... strs) { - return null; - } - public Test(Runnable r, String... strs) {} - public Test(Runnable r1, Runnable r2, String... strs) {} -} - -// FILE: main.kt -fun box(): String { - val x1 = {} - val x2: Runnable = Runnable { } - val x3 = arrayOf() - - Test.foo1({}, arrayOf()) - Test.foo1({}, arrayOf("")) - - Test.foo1(x1, arrayOf()) - Test.foo1(x2, *arrayOf()) - - Test.foo1(x1, x3) - Test.foo1(x2, *arrayOf("")) - - val i1 = Test({}, arrayOf()) - val i3 = Test({}, x3) - val i4 = Test({}, arrayOf("")) - val i6 = Test({}, {}, arrayOf()) - - i1.foo2({}, {}, arrayOf()) - i1.foo2({}, {}, arrayOf("")) - - return "OK" -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgument.fir.kt b/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgument.fir.kt index 7b117600a13..cbab12a2f2b 100644 --- a/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgument.fir.kt +++ b/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgument.fir.kt @@ -12,7 +12,7 @@ public class Test { return null; } public Test(Runnable r, String... strs) {} - public Test(Runnable r, Runnable r, String... strs) {} + public Test(Runnable r1, Runnable r2, String... strs) {} } // FILE: main.kt @@ -42,13 +42,13 @@ fun main(x2: Runnable) { val i5 = Test({}, {}, *arrayOf("")) val i6 = Test({}, {}, arrayOf()) - i1.foo2({}, {}, arrayOf()) - i1.foo2({}, {}, *arrayOf()) - i1.foo2({}, x2, arrayOf()) - i1.foo2(x2, {}, *arrayOf()) + i2.foo2({}, {}, arrayOf()) + i2.foo2({}, {}, *arrayOf()) + i2.foo2({}, x2, arrayOf()) + i2.foo2(x2, {}, *arrayOf()) - i1.foo2({}, {}, arrayOf("")) - i1.foo2({}, {}, *x3) - i1.foo2({}, x2, x3) - i1.foo2(x2, {}, *arrayOf("")) + i2.foo2({}, {}, arrayOf("")) + i2.foo2({}, {}, *x3) + i2.foo2({}, x2, x3) + i2.foo2(x2, {}, *arrayOf("")) } diff --git a/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgument.kt b/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgument.kt index 27064b74806..914565f6f7c 100644 --- a/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgument.kt +++ b/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgument.kt @@ -12,7 +12,7 @@ public class Test { return null; } public Test(Runnable r, String... strs) {} - public Test(Runnable r, Runnable r, String... strs) {} + public Test(Runnable r1, Runnable r2, String... strs) {} } // FILE: main.kt @@ -42,13 +42,13 @@ fun main(x2: Runnable) { val i5 = Test({}, {}, *arrayOf("")) val i6 = Test({}, {}, arrayOf()) - i1.foo2({}, {}, arrayOf()) - i1.foo2({}, {}, *arrayOf()) - i1.foo2({}, x2, arrayOf()) - i1.foo2(x2, {}, *arrayOf()) + i2.foo2({}, {}, arrayOf()) + i2.foo2({}, {}, *arrayOf()) + i2.foo2({}, x2, arrayOf()) + i2.foo2(x2, {}, *arrayOf()) - i1.foo2({}, {}, arrayOf("")) - i1.foo2({}, {}, *x3) - i1.foo2({}, x2, x3) - i1.foo2(x2, {}, *arrayOf("")) + i2.foo2({}, {}, arrayOf("")) + i2.foo2({}, {}, *x3) + i2.foo2({}, x2, x3) + i2.foo2(x2, {}, *arrayOf("")) } diff --git a/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentProhibited.fir.kt b/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentProhibited.fir.kt index c793fba46ee..56210493208 100644 --- a/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentProhibited.fir.kt +++ b/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentProhibited.fir.kt @@ -12,7 +12,7 @@ public class Test { return null; } public Test(Runnable r, String... strs) {} - public Test(Runnable r, Runnable r, String... strs) {} + public Test(Runnable r1, Runnable r2, String... strs) {} } // FILE: main.kt diff --git a/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentProhibited.kt b/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentProhibited.kt index 61f1ca77387..b592083563c 100644 --- a/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentProhibited.kt +++ b/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentProhibited.kt @@ -12,7 +12,7 @@ public class Test { return null; } public Test(Runnable r, String... strs) {} - public Test(Runnable r, Runnable r, String... strs) {} + public Test(Runnable r1, Runnable r2, String... strs) {} } // FILE: main.kt diff --git a/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.fir.kt b/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.fir.kt index bd59ac25695..04bf1ebba3b 100644 --- a/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.fir.kt +++ b/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.fir.kt @@ -12,7 +12,7 @@ public class Test { return null; } public Test(Runnable r, String... strs) {} - public Test(Runnable r, Runnable r, String... strs) {} + public Test(Runnable r1, Runnable r2, String... strs) {} } // FILE: main.kt diff --git a/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.kt b/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.kt index 367682d7cdb..55ea9d953c3 100644 --- a/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.kt +++ b/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.kt @@ -12,7 +12,7 @@ public class Test { return null; } public Test(Runnable r, String... strs) {} - public Test(Runnable r, Runnable r, String... strs) {} + public Test(Runnable r1, Runnable r2, String... strs) {} } // FILE: main.kt 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 c7258387bd5..a2e3a1b2235 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 @@ -34436,12 +34436,6 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/sam/arrayAsVarargAfterSamArgument.kt"); } - @Test - @TestMetadata("arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.kt") - public void testArrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument() throws Exception { - runTest("compiler/testData/codegen/box/sam/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.kt"); - } - @Test @TestMetadata("castFromAny.kt") public void testCastFromAny() 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 3ab6cebe6fc..c3c4540ed55 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 @@ -34236,12 +34236,6 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/sam/arrayAsVarargAfterSamArgument.kt"); } - @Test - @TestMetadata("arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.kt") - public void testArrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument() throws Exception { - runTest("compiler/testData/codegen/box/sam/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.kt"); - } - @Test @TestMetadata("castFromAny.kt") public void testCastFromAny() 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 b5ddf119858..b7aaedc80d1 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -28085,11 +28085,6 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/sam/arrayAsVarargAfterSamArgument.kt"); } - @TestMetadata("arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.kt") - public void testArrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument() throws Exception { - runTest("compiler/testData/codegen/box/sam/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.kt"); - } - @TestMetadata("castFromAny.kt") public void testCastFromAny() throws Exception { runTest("compiler/testData/codegen/box/sam/castFromAny.kt");