diff --git a/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/FirOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/FirOldFrontendDiagnosticsTestGenerated.java index 1b907cbe789..441ed8fde0f 100644 --- a/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/FirOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/FirOldFrontendDiagnosticsTestGenerated.java @@ -1794,6 +1794,11 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirOldFronte runTest("compiler/testData/diagnostics/tests/callableReference/classVsPackage.kt"); } + @TestMetadata("compatibilityResolveWithVarargAndOperatorCall.kt") + public void testCompatibilityResolveWithVarargAndOperatorCall() throws Exception { + runTest("compiler/testData/diagnostics/tests/callableReference/compatibilityResolveWithVarargAndOperatorCall.kt"); + } + @TestMetadata("constraintFromLHSWithCorrectDirection.kt") public void testConstraintFromLHSWithCorrectDirection() throws Exception { runTest("compiler/testData/diagnostics/tests/callableReference/constraintFromLHSWithCorrectDirection.kt"); @@ -1804,6 +1809,11 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirOldFronte runTest("compiler/testData/diagnostics/tests/callableReference/constraintFromLHSWithCorrectDirectionError.kt"); } + @TestMetadata("correctCandidateWithCompatibilityForSeveralCandidates.kt") + public void testCorrectCandidateWithCompatibilityForSeveralCandidates() throws Exception { + runTest("compiler/testData/diagnostics/tests/callableReference/correctCandidateWithCompatibilityForSeveralCandidates.kt"); + } + @TestMetadata("correctInfoAfterArrayLikeCall.kt") public void testCorrectInfoAfterArrayLikeCall() throws Exception { runTest("compiler/testData/diagnostics/tests/callableReference/correctInfoAfterArrayLikeCall.kt"); @@ -1974,6 +1984,11 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirOldFronte runTest("compiler/testData/diagnostics/tests/callableReference/typealiases.kt"); } + @TestMetadata("unitAdaptationForReferenceCompatibility.kt") + public void testUnitAdaptationForReferenceCompatibility() throws Exception { + runTest("compiler/testData/diagnostics/tests/callableReference/unitAdaptationForReferenceCompatibility.kt"); + } + @TestMetadata("unused.kt") public void testUnused() throws Exception { runTest("compiler/testData/diagnostics/tests/callableReference/unused.kt"); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/KotlinToResolvedCallTransformer.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/KotlinToResolvedCallTransformer.kt index 7a49965b673..cd7df0c5af0 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/KotlinToResolvedCallTransformer.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/KotlinToResolvedCallTransformer.kt @@ -287,9 +287,12 @@ class KotlinToResolvedCallTransformer( is ArgumentMatch -> { parameter = argumentMapping.valueParameter + // We should take expected type from the last used conversion + // TODO: move this logic into ParameterTypeConversion val expectedType = - resolvedCall.getExpectedTypeForSamConvertedArgument(valueArgument) + resolvedCall.getExpectedTypeForUnitConvertedArgument(valueArgument) ?: resolvedCall.getExpectedTypeForSuspendConvertedArgument(valueArgument) + ?: resolvedCall.getExpectedTypeForSamConvertedArgument(valueArgument) ?: getEffectiveExpectedType(argumentMapping.valueParameter, valueArgument, context) Pair( expectedType, @@ -667,6 +670,7 @@ class NewResolvedCallImpl( private var smartCastDispatchReceiverType: KotlinType? = null private var expectedTypeForSamConvertedArgumentMap: MutableMap? = null private var expectedTypeForSuspendConvertedArgumentMap: MutableMap? = null + private var expectedTypeForUnitConvertedArgumentMap: MutableMap? = null private var argumentTypeForConstantConvertedMap: MutableMap? = null @@ -749,6 +753,7 @@ class NewResolvedCallImpl( calculateExpectedTypeForSamConvertedArgumentMap(substitutor) calculateExpectedTypeForSuspendConvertedArgumentMap(substitutor) + calculateExpectedTypeForUnitConvertedArgumentMap(substitutor) calculateExpectedTypeForConstantConvertedArgumentMap() } @@ -820,6 +825,9 @@ class NewResolvedCallImpl( fun getExpectedTypeForSuspendConvertedArgument(valueArgument: ValueArgument): UnwrappedType? = expectedTypeForSuspendConvertedArgumentMap?.get(valueArgument) + fun getExpectedTypeForUnitConvertedArgument(valueArgument: ValueArgument): UnwrappedType? = + expectedTypeForUnitConvertedArgumentMap?.get(valueArgument) + private fun calculateExpectedTypeForConstantConvertedArgumentMap() { if (resolvedCallAtom.argumentsWithConstantConversion.isEmpty()) return @@ -853,6 +861,18 @@ class NewResolvedCallImpl( } } + private fun calculateExpectedTypeForUnitConvertedArgumentMap(substitutor: NewTypeSubstitutor?) { + if (resolvedCallAtom.argumentsWithUnitConversion.isEmpty()) return + + expectedTypeForUnitConvertedArgumentMap = hashMapOf() + for ((argument, convertedType) in resolvedCallAtom.argumentsWithUnitConversion) { + val typeWithFreshVariables = resolvedCallAtom.freshVariablesSubstitutor.safeSubstitute(convertedType) + val expectedType = substitutor?.safeSubstitute(typeWithFreshVariables) ?: typeWithFreshVariables + expectedTypeForUnitConvertedArgumentMap!![argument.psiCallArgument.valueArgument] = expectedType + } + } + + override fun argumentToParameterMap( resultingDescriptor: CallableDescriptor, valueArguments: Map, @@ -905,7 +925,8 @@ class NewResolvedCallImpl( fun ResolutionCandidateApplicability.toResolutionStatus(): ResolutionStatus = when (this) { ResolutionCandidateApplicability.RESOLVED, ResolutionCandidateApplicability.RESOLVED_LOW_PRIORITY, - ResolutionCandidateApplicability.RESOLVED_WITH_ERROR -> ResolutionStatus.SUCCESS + ResolutionCandidateApplicability.RESOLVED_WITH_ERROR, + ResolutionCandidateApplicability.RESOLVED_NEED_PRESERVE_COMPATIBILITY -> ResolutionStatus.SUCCESS ResolutionCandidateApplicability.INAPPLICABLE_WRONG_RECEIVER -> ResolutionStatus.RECEIVER_TYPE_ERROR else -> ResolutionStatus.OTHER_ERROR } diff --git a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/CallableReferenceResolver.kt b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/CallableReferenceResolver.kt index ab16ed548da..809b2223de8 100644 --- a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/CallableReferenceResolver.kt +++ b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/CallableReferenceResolver.kt @@ -110,7 +110,6 @@ class CallableReferenceResolver( chosenCandidate.diagnostics.forEach { val transformedDiagnostic = when (it) { is CompatibilityWarning -> CompatibilityWarningOnArgument(argument, it.candidate) - is LowerPriorityToPreserveCompatibility -> return@forEach else -> it } diagnosticsHolder.addDiagnostic(transformedDiagnostic) diff --git a/compiler/testData/diagnostics/tests/callableReference/compatibilityResolveWithVarargAndOperatorCall.fir.kt b/compiler/testData/diagnostics/tests/callableReference/compatibilityResolveWithVarargAndOperatorCall.fir.kt new file mode 100644 index 00000000000..2061cdfd368 --- /dev/null +++ b/compiler/testData/diagnostics/tests/callableReference/compatibilityResolveWithVarargAndOperatorCall.fir.kt @@ -0,0 +1,18 @@ +// !DIAGNOSTICS: -UNUSED_PARAMETER + +fun interface IFoo { + fun foo(i: Int) +} + +fun interface IFoo2 : IFoo + +object A + +operator fun A.get(i: IFoo) = 1 +operator fun A.set(i: IFoo, newValue: Int) {} + +fun withVararg(vararg xs: Int) = 42 + +fun test1() { + A[::withVararg] += 1 +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/callableReference/compatibilityResolveWithVarargAndOperatorCall.kt b/compiler/testData/diagnostics/tests/callableReference/compatibilityResolveWithVarargAndOperatorCall.kt new file mode 100644 index 00000000000..c012456ffbe --- /dev/null +++ b/compiler/testData/diagnostics/tests/callableReference/compatibilityResolveWithVarargAndOperatorCall.kt @@ -0,0 +1,18 @@ +// !DIAGNOSTICS: -UNUSED_PARAMETER + +fun interface IFoo { + fun foo(i: Int) +} + +fun interface IFoo2 : IFoo + +object A + +operator fun A.get(i: IFoo) = 1 +operator fun A.set(i: IFoo, newValue: Int) {} + +fun withVararg(vararg xs: Int) = 42 + +fun test1() { + A[::withVararg] += 1 +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/callableReference/compatibilityResolveWithVarargAndOperatorCall.txt b/compiler/testData/diagnostics/tests/callableReference/compatibilityResolveWithVarargAndOperatorCall.txt new file mode 100644 index 00000000000..d50392e7fbb --- /dev/null +++ b/compiler/testData/diagnostics/tests/callableReference/compatibilityResolveWithVarargAndOperatorCall.txt @@ -0,0 +1,27 @@ +package + +public fun test1(): kotlin.Unit +public fun withVararg(/*0*/ vararg xs: kotlin.Int /*kotlin.IntArray*/): kotlin.Int +public operator fun A.get(/*0*/ i: IFoo): kotlin.Int +public operator fun A.set(/*0*/ i: IFoo, /*1*/ newValue: kotlin.Int): kotlin.Unit + +public object A { + private constructor A() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public fun interface IFoo { + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public abstract fun foo(/*0*/ i: kotlin.Int): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public fun interface IFoo2 : IFoo { + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public abstract override /*1*/ /*fake_override*/ fun foo(/*0*/ i: kotlin.Int): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/testData/diagnostics/tests/callableReference/correctCandidateWithCompatibilityForSeveralCandidates.fir.kt b/compiler/testData/diagnostics/tests/callableReference/correctCandidateWithCompatibilityForSeveralCandidates.fir.kt new file mode 100644 index 00000000000..ce4b6ed6bea --- /dev/null +++ b/compiler/testData/diagnostics/tests/callableReference/correctCandidateWithCompatibilityForSeveralCandidates.fir.kt @@ -0,0 +1,21 @@ +// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION + +fun foo(f: () -> T): T = f() + +fun bar(): Unit {} + +object Scope { + fun bar(s: String = ""): Double = 0.0 + + fun foo(f: () -> T): T = f() + + object NestedScope { + fun bar(a: Int = 0): String = "" + + fun test() { + // Despite the fact ::bar is resolved with compatibility warning, it's important not to propagate it to the outer call + val result = foo(::bar) + result + } + } +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/callableReference/correctCandidateWithCompatibilityForSeveralCandidates.kt b/compiler/testData/diagnostics/tests/callableReference/correctCandidateWithCompatibilityForSeveralCandidates.kt new file mode 100644 index 00000000000..cdc11917dfe --- /dev/null +++ b/compiler/testData/diagnostics/tests/callableReference/correctCandidateWithCompatibilityForSeveralCandidates.kt @@ -0,0 +1,21 @@ +// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION + +fun foo(f: () -> T): T = f() + +fun bar(): Unit {} + +object Scope { + fun bar(s: String = ""): Double = 0.0 + + fun foo(f: () -> T): T = f() + + object NestedScope { + fun bar(a: Int = 0): String = "" + + fun test() { + // Despite the fact ::bar is resolved with compatibility warning, it's important not to propagate it to the outer call + val result = foo(::bar) + result + } + } +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/callableReference/correctCandidateWithCompatibilityForSeveralCandidates.txt b/compiler/testData/diagnostics/tests/callableReference/correctCandidateWithCompatibilityForSeveralCandidates.txt new file mode 100644 index 00000000000..a3a987ed6b9 --- /dev/null +++ b/compiler/testData/diagnostics/tests/callableReference/correctCandidateWithCompatibilityForSeveralCandidates.txt @@ -0,0 +1,22 @@ +package + +public fun bar(): kotlin.Unit +public fun foo(/*0*/ f: () -> T): T + +public object Scope { + private constructor Scope() + public final fun bar(/*0*/ s: kotlin.String = ...): kotlin.Double + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public final fun foo(/*0*/ f: () -> T): T + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + + public object NestedScope { + private constructor NestedScope() + public final fun bar(/*0*/ a: kotlin.Int = ...): kotlin.String + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public final fun test(): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } +} diff --git a/compiler/testData/diagnostics/tests/callableReference/unitAdaptationForReferenceCompatibility.fir.kt b/compiler/testData/diagnostics/tests/callableReference/unitAdaptationForReferenceCompatibility.fir.kt new file mode 100644 index 00000000000..4f96216a149 --- /dev/null +++ b/compiler/testData/diagnostics/tests/callableReference/unitAdaptationForReferenceCompatibility.fir.kt @@ -0,0 +1,25 @@ +// FILE: Callable.java + +public interface Callable { + V call() throws Exception; +} + +// FILE: Future.java + +public class Future {} + +// FILE: Executor.java + +public interface Executor { + Future submit(Callable task); + Future submit(Runnable task); +} + +// FILE: test.kt + +fun f(): String = "test" + +class A { + fun schedule1(e: Executor): Future = e.submit(::f) + fun schedule2(e: Executor): Future = e.submit { f() } +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/callableReference/unitAdaptationForReferenceCompatibility.kt b/compiler/testData/diagnostics/tests/callableReference/unitAdaptationForReferenceCompatibility.kt new file mode 100644 index 00000000000..2c4af34f710 --- /dev/null +++ b/compiler/testData/diagnostics/tests/callableReference/unitAdaptationForReferenceCompatibility.kt @@ -0,0 +1,25 @@ +// FILE: Callable.java + +public interface Callable { + V call() throws Exception; +} + +// FILE: Future.java + +public class Future {} + +// FILE: Executor.java + +public interface Executor { + Future submit(Callable task); + Future submit(Runnable task); +} + +// FILE: test.kt + +fun f(): String = "test" + +class A { + fun schedule1(e: Executor): Future = e.submit(::f) + fun schedule2(e: Executor): Future = e.submit { f() } +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/callableReference/unitAdaptationForReferenceCompatibility.txt b/compiler/testData/diagnostics/tests/callableReference/unitAdaptationForReferenceCompatibility.txt new file mode 100644 index 00000000000..5f89f1ea17f --- /dev/null +++ b/compiler/testData/diagnostics/tests/callableReference/unitAdaptationForReferenceCompatibility.txt @@ -0,0 +1,34 @@ +package + +public fun f(): kotlin.String + +public final class A { + public constructor A() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public final fun schedule1(/*0*/ e: Executor): Future + public final fun schedule2(/*0*/ e: Executor): Future + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public interface Callable { + public abstract fun call(): V! + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public interface Executor { + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public abstract fun submit(/*0*/ task: Callable!): Future! + public abstract fun submit(/*0*/ task: java.lang.Runnable!): Future<*>! + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public open class Future { + public constructor Future() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/testData/diagnostics/tests/unitConversion/unitConversionForSubtypes.kt b/compiler/testData/diagnostics/tests/unitConversion/unitConversionForSubtypes.kt index c8995b7d9e6..f9ac6ccfaf7 100644 --- a/compiler/testData/diagnostics/tests/unitConversion/unitConversionForSubtypes.kt +++ b/compiler/testData/diagnostics/tests/unitConversion/unitConversionForSubtypes.kt @@ -14,7 +14,7 @@ fun test1(s: SubInt, sWrong: SubIntWrong) { foo(a) a as (Int, String) -> String - foo(a) + foo(a) } fun test2(x: T) where T : (Int, String) -> Int, T : (Double) -> Int { diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java index 6b58df3d27a..9fdf5fca1ef 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java @@ -1801,6 +1801,11 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTestWithFirVali runTest("compiler/testData/diagnostics/tests/callableReference/classVsPackage.kt"); } + @TestMetadata("compatibilityResolveWithVarargAndOperatorCall.kt") + public void testCompatibilityResolveWithVarargAndOperatorCall() throws Exception { + runTest("compiler/testData/diagnostics/tests/callableReference/compatibilityResolveWithVarargAndOperatorCall.kt"); + } + @TestMetadata("constraintFromLHSWithCorrectDirection.kt") public void testConstraintFromLHSWithCorrectDirection() throws Exception { runTest("compiler/testData/diagnostics/tests/callableReference/constraintFromLHSWithCorrectDirection.kt"); @@ -1811,6 +1816,11 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTestWithFirVali runTest("compiler/testData/diagnostics/tests/callableReference/constraintFromLHSWithCorrectDirectionError.kt"); } + @TestMetadata("correctCandidateWithCompatibilityForSeveralCandidates.kt") + public void testCorrectCandidateWithCompatibilityForSeveralCandidates() throws Exception { + runTest("compiler/testData/diagnostics/tests/callableReference/correctCandidateWithCompatibilityForSeveralCandidates.kt"); + } + @TestMetadata("correctInfoAfterArrayLikeCall.kt") public void testCorrectInfoAfterArrayLikeCall() throws Exception { runTest("compiler/testData/diagnostics/tests/callableReference/correctInfoAfterArrayLikeCall.kt"); @@ -1981,6 +1991,11 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTestWithFirVali runTest("compiler/testData/diagnostics/tests/callableReference/typealiases.kt"); } + @TestMetadata("unitAdaptationForReferenceCompatibility.kt") + public void testUnitAdaptationForReferenceCompatibility() throws Exception { + runTest("compiler/testData/diagnostics/tests/callableReference/unitAdaptationForReferenceCompatibility.kt"); + } + @TestMetadata("unused.kt") public void testUnused() throws Exception { runTest("compiler/testData/diagnostics/tests/callableReference/unused.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java index ad8d79fca87..cf83369550e 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java @@ -1796,6 +1796,11 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing runTest("compiler/testData/diagnostics/tests/callableReference/classVsPackage.kt"); } + @TestMetadata("compatibilityResolveWithVarargAndOperatorCall.kt") + public void testCompatibilityResolveWithVarargAndOperatorCall() throws Exception { + runTest("compiler/testData/diagnostics/tests/callableReference/compatibilityResolveWithVarargAndOperatorCall.kt"); + } + @TestMetadata("constraintFromLHSWithCorrectDirection.kt") public void testConstraintFromLHSWithCorrectDirection() throws Exception { runTest("compiler/testData/diagnostics/tests/callableReference/constraintFromLHSWithCorrectDirection.kt"); @@ -1806,6 +1811,11 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing runTest("compiler/testData/diagnostics/tests/callableReference/constraintFromLHSWithCorrectDirectionError.kt"); } + @TestMetadata("correctCandidateWithCompatibilityForSeveralCandidates.kt") + public void testCorrectCandidateWithCompatibilityForSeveralCandidates() throws Exception { + runTest("compiler/testData/diagnostics/tests/callableReference/correctCandidateWithCompatibilityForSeveralCandidates.kt"); + } + @TestMetadata("correctInfoAfterArrayLikeCall.kt") public void testCorrectInfoAfterArrayLikeCall() throws Exception { runTest("compiler/testData/diagnostics/tests/callableReference/correctInfoAfterArrayLikeCall.kt"); @@ -1976,6 +1986,11 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing runTest("compiler/testData/diagnostics/tests/callableReference/typealiases.kt"); } + @TestMetadata("unitAdaptationForReferenceCompatibility.kt") + public void testUnitAdaptationForReferenceCompatibility() throws Exception { + runTest("compiler/testData/diagnostics/tests/callableReference/unitAdaptationForReferenceCompatibility.kt"); + } + @TestMetadata("unused.kt") public void testUnused() throws Exception { runTest("compiler/testData/diagnostics/tests/callableReference/unused.kt");