diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java index 6052161d5f7..7d5f5fffa50 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java @@ -4833,6 +4833,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia runTest("compiler/testData/diagnostics/tests/callableReference/function/ambiguityTopLevelVsTopLevel.kt"); } + @Test + @TestMetadata("ambiguityTopLevelVsTopLevelGeneric.kt") + public void testAmbiguityTopLevelVsTopLevelGeneric() throws Exception { + runTest("compiler/testData/diagnostics/tests/callableReference/function/ambiguityTopLevelVsTopLevelGeneric.kt"); + } + @Test @TestMetadata("annotationClassConstructor.kt") public void testAnnotationClassConstructor() throws Exception { @@ -17463,6 +17469,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia runTest("compiler/testData/diagnostics/tests/inference/callableReferences/conversionLastStatementInLambda.kt"); } + @Test + @TestMetadata("conversionLastStatementInLambdaGeneric.kt") + public void testConversionLastStatementInLambdaGeneric() throws Exception { + runTest("compiler/testData/diagnostics/tests/inference/callableReferences/conversionLastStatementInLambdaGeneric.kt"); + } + @Test @TestMetadata("kt55931.kt") public void testKt55931() throws Exception { @@ -17825,6 +17837,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia runTest("compiler/testData/diagnostics/tests/inference/coercionToUnit/coersionWithAnonymousFunctionsAndUnresolved.kt"); } + @Test + @TestMetadata("genericInApply.kt") + public void testGenericInApply() throws Exception { + runTest("compiler/testData/diagnostics/tests/inference/coercionToUnit/genericInApply.kt"); + } + @Test @TestMetadata("indirectCoercionWithExpectedType.kt") public void testIndirectCoercionWithExpectedType() throws Exception { diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java index 61596dd7d8d..3656e49e719 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java @@ -4833,6 +4833,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated runTest("compiler/testData/diagnostics/tests/callableReference/function/ambiguityTopLevelVsTopLevel.kt"); } + @Test + @TestMetadata("ambiguityTopLevelVsTopLevelGeneric.kt") + public void testAmbiguityTopLevelVsTopLevelGeneric() throws Exception { + runTest("compiler/testData/diagnostics/tests/callableReference/function/ambiguityTopLevelVsTopLevelGeneric.kt"); + } + @Test @TestMetadata("annotationClassConstructor.kt") public void testAnnotationClassConstructor() throws Exception { @@ -17463,6 +17469,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated runTest("compiler/testData/diagnostics/tests/inference/callableReferences/conversionLastStatementInLambda.kt"); } + @Test + @TestMetadata("conversionLastStatementInLambdaGeneric.kt") + public void testConversionLastStatementInLambdaGeneric() throws Exception { + runTest("compiler/testData/diagnostics/tests/inference/callableReferences/conversionLastStatementInLambdaGeneric.kt"); + } + @Test @TestMetadata("kt55931.kt") public void testKt55931() throws Exception { @@ -17825,6 +17837,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated runTest("compiler/testData/diagnostics/tests/inference/coercionToUnit/coersionWithAnonymousFunctionsAndUnresolved.kt"); } + @Test + @TestMetadata("genericInApply.kt") + public void testGenericInApply() throws Exception { + runTest("compiler/testData/diagnostics/tests/inference/coercionToUnit/genericInApply.kt"); + } + @Test @TestMetadata("indirectCoercionWithExpectedType.kt") public void testIndirectCoercionWithExpectedType() throws Exception { diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java index 2d3cd24f57c..2e61fca1cea 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java @@ -4827,6 +4827,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir runTest("compiler/testData/diagnostics/tests/callableReference/function/ambiguityTopLevelVsTopLevel.kt"); } + @Test + @TestMetadata("ambiguityTopLevelVsTopLevelGeneric.kt") + public void testAmbiguityTopLevelVsTopLevelGeneric() throws Exception { + runTest("compiler/testData/diagnostics/tests/callableReference/function/ambiguityTopLevelVsTopLevelGeneric.kt"); + } + @Test @TestMetadata("annotationClassConstructor.kt") public void testAnnotationClassConstructor() throws Exception { @@ -17457,6 +17463,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir runTest("compiler/testData/diagnostics/tests/inference/callableReferences/conversionLastStatementInLambda.kt"); } + @Test + @TestMetadata("conversionLastStatementInLambdaGeneric.kt") + public void testConversionLastStatementInLambdaGeneric() throws Exception { + runTest("compiler/testData/diagnostics/tests/inference/callableReferences/conversionLastStatementInLambdaGeneric.kt"); + } + @Test @TestMetadata("kt55931.kt") public void testKt55931() throws Exception { @@ -17819,6 +17831,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir runTest("compiler/testData/diagnostics/tests/inference/coercionToUnit/coersionWithAnonymousFunctionsAndUnresolved.kt"); } + @Test + @TestMetadata("genericInApply.kt") + public void testGenericInApply() throws Exception { + runTest("compiler/testData/diagnostics/tests/inference/coercionToUnit/genericInApply.kt"); + } + @Test @TestMetadata("indirectCoercionWithExpectedType.kt") public void testIndirectCoercionWithExpectedType() throws Exception { diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java index 57feba1b3bd..0e904b89652 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java @@ -4833,6 +4833,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia runTest("compiler/testData/diagnostics/tests/callableReference/function/ambiguityTopLevelVsTopLevel.kt"); } + @Test + @TestMetadata("ambiguityTopLevelVsTopLevelGeneric.kt") + public void testAmbiguityTopLevelVsTopLevelGeneric() throws Exception { + runTest("compiler/testData/diagnostics/tests/callableReference/function/ambiguityTopLevelVsTopLevelGeneric.kt"); + } + @Test @TestMetadata("annotationClassConstructor.kt") public void testAnnotationClassConstructor() throws Exception { @@ -17463,6 +17469,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia runTest("compiler/testData/diagnostics/tests/inference/callableReferences/conversionLastStatementInLambda.kt"); } + @Test + @TestMetadata("conversionLastStatementInLambdaGeneric.kt") + public void testConversionLastStatementInLambdaGeneric() throws Exception { + runTest("compiler/testData/diagnostics/tests/inference/callableReferences/conversionLastStatementInLambdaGeneric.kt"); + } + @Test @TestMetadata("kt55931.kt") public void testKt55931() throws Exception { @@ -17825,6 +17837,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia runTest("compiler/testData/diagnostics/tests/inference/coercionToUnit/coersionWithAnonymousFunctionsAndUnresolved.kt"); } + @Test + @TestMetadata("genericInApply.kt") + public void testGenericInApply() throws Exception { + runTest("compiler/testData/diagnostics/tests/inference/coercionToUnit/genericInApply.kt"); + } + @Test @TestMetadata("indirectCoercionWithExpectedType.kt") public void testIndirectCoercionWithExpectedType() throws Exception { diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/FirCallResolver.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/FirCallResolver.kt index c0a07b5f7da..b5bd9c0a36d 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/FirCallResolver.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/FirCallResolver.kt @@ -375,6 +375,7 @@ class FirCallResolver( fun resolveCallableReference( constraintSystemBuilder: ConstraintSystemBuilder, resolvedCallableReferenceAtom: ResolvedCallableReferenceAtom, + hasSyntheticOuterCall: Boolean, ): Pair { val callableReferenceAccess = resolvedCallableReferenceAtom.reference val calleeReference = callableReferenceAccess.calleeReference @@ -383,8 +384,7 @@ class FirCallResolver( val expectedType = resolvedCallableReferenceAtom.expectedType?.let(coneSubstitutor::substituteOrSelf) val info = createCallableReferencesInfoForLHS( - callableReferenceAccess, lhs, - expectedType, constraintSystemBuilder, + callableReferenceAccess, lhs, expectedType, constraintSystemBuilder, hasSyntheticOuterCall ) // No reset here! val localCollector = CandidateCollector(components, components.resolutionStageRunner) @@ -685,6 +685,7 @@ class FirCallResolver( lhs: DoubleColonLHS?, expectedType: ConeKotlinType?, outerConstraintSystemBuilder: ConstraintSystemBuilder?, + hasSyntheticOuterCall: Boolean, ): CallInfo { return CallInfo( callableReferenceAccess, @@ -703,6 +704,7 @@ class FirCallResolver( expectedType, outerConstraintSystemBuilder, lhs, + hasSyntheticOuterCall, ) } diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/CallInfo.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/CallInfo.kt index 68adade4157..c15557e1aea 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/CallInfo.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/CallInfo.kt @@ -37,10 +37,11 @@ data class CallInfo( val candidateForCommonInvokeReceiver: Candidate? = null, - // Four properties for callable references only + // Five properties for callable references only val expectedType: ConeKotlinType? = null, val outerCSBuilder: ConstraintSystemBuilder? = null, val lhs: DoubleColonLHS? = null, + val hasSyntheticOuterCall: Boolean = false, val origin: FirFunctionCallOrigin = FirFunctionCallOrigin.Regular, ) : AbstractCallInfo() { val arguments: List get() = argumentList.arguments diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/CallableReferenceResolution.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/CallableReferenceResolution.kt index f8bd4d09381..b47aded151a 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/CallableReferenceResolution.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/CallableReferenceResolution.kt @@ -136,18 +136,33 @@ private fun buildResultingTypeAndAdaptation( parameters += receiverType } - val returnType = callableReferenceAdaptation?.let { - parameters += it.argumentTypes - if (it.coercionStrategy == CoercionStrategy.COERCION_TO_UNIT) { - context.session.builtinTypes.unitType.type - } else { - returnTypeRef.coneType + val returnTypeWithoutCoercion = returnTypeRef.coneType + val returnType = if (callableReferenceAdaptation == null) { + returnTypeWithoutCoercion.also { + fir.valueParameters.mapTo(parameters) { it.returnTypeRef.coneType } + } + } else { + parameters += callableReferenceAdaptation.argumentTypes + // K1 simply doesn't perform any conversions for so-called "top level callable references", + // only for "callable reference arguments" + // (see CallableReferencesCandidateFactory.buildReflectionType, val buildTypeWithConversions) + // Here hasSyntheticOuterCall is ~ an equivalent of "top level callable references" in K1 + // K2 behavior differs at least in two aspects: + // - it still allows to drop some default parameters / convert some varargs + // - see testData/diagnostics/tests/callableReference/adapted/simpleAdaptationOutsideOfCall.kt + // - see testData/diagnostics/tests/callableReference/resolve/withVararg.kt + // - coercion to unit is still allowed if a candidate return type is not type parameter based + // - see testData/diagnostics/tests/inference/callableReferences/conversionLastStatementInLambda.kt + val hasSyntheticOuterCall = candidate.callInfo.hasSyntheticOuterCall + if (callableReferenceAdaptation.coercionStrategy != CoercionStrategy.COERCION_TO_UNIT || + hasSyntheticOuterCall && returnTypeWithoutCoercion.unwrapFlexibleAndDefinitelyNotNull() is ConeTypeParameterType + ) { + returnTypeWithoutCoercion + } else { + context.session.builtinTypes.unitType.type } - } ?: returnTypeRef.coneType.also { - fir.valueParameters.mapTo(parameters) { it.returnTypeRef.coneType } } - val baseFunctionTypeKind = callableReferenceAdaptation?.suspendConversionStrategy?.kind ?: fir.specialFunctionTypeKind(context.session) ?: FunctionTypeKind.Function diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/ResolutionStages.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/ResolutionStages.kt index e4a9235cee6..30a3ac85254 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/ResolutionStages.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/ResolutionStages.kt @@ -30,6 +30,7 @@ import org.jetbrains.kotlin.fir.scopes.impl.typeAliasForConstructor import org.jetbrains.kotlin.fir.scopes.processOverriddenFunctions import org.jetbrains.kotlin.fir.symbols.ConeTypeParameterLookupTag import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol +import org.jetbrains.kotlin.fir.symbols.SyntheticCallableId.ACCEPT_SPECIFIC_TYPE import org.jetbrains.kotlin.fir.symbols.SyntheticSymbol import org.jetbrains.kotlin.fir.symbols.impl.* import org.jetbrains.kotlin.fir.symbols.lazyResolveToPhase @@ -562,7 +563,9 @@ internal object EagerResolveOfCallableReferences : CheckerStage() { for (atom in candidate.postponedAtoms) { if (atom is ResolvedCallableReferenceAtom) { val (applicability, success) = - context.bodyResolveComponents.callResolver.resolveCallableReference(candidate.csBuilder, atom) + context.bodyResolveComponents.callResolver.resolveCallableReference( + candidate.csBuilder, atom, hasSyntheticOuterCall = candidate.callInfo.name == ACCEPT_SPECIFIC_TYPE.callableName + ) if (!success) { // If the resolution was unsuccessful, we ensure that an error will be reported for the callable reference // during completion by using the `resultingReference` of the postponed atom. diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/PostponedArgumentsAnalyzer.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/PostponedArgumentsAnalyzer.kt index 3b4b7a8005b..bb3f84befb4 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/PostponedArgumentsAnalyzer.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/PostponedArgumentsAnalyzer.kt @@ -66,7 +66,7 @@ class PostponedArgumentsAnalyzer( private fun processCallableReference(atom: ResolvedCallableReferenceAtom, candidate: Candidate) { if (atom.mightNeedAdditionalResolution) { - callResolver.resolveCallableReference(candidate.csBuilder, atom) + callResolver.resolveCallableReference(candidate.csBuilder, atom, hasSyntheticOuterCall = false) } val callableReferenceAccess = atom.reference diff --git a/compiler/testData/diagnostics/tests/callableReference/function/ambiguityTopLevelVsTopLevelGeneric.fir.kt b/compiler/testData/diagnostics/tests/callableReference/function/ambiguityTopLevelVsTopLevelGeneric.fir.kt new file mode 100644 index 00000000000..4c3da5acc7d --- /dev/null +++ b/compiler/testData/diagnostics/tests/callableReference/function/ambiguityTopLevelVsTopLevelGeneric.fir.kt @@ -0,0 +1,8 @@ +fun foo(x: Int, y: Any): Int = x + +fun bar(x: T, y: Any): T = x + +fun main() { + val fooRef: (Int, Any) -> Unit = ::foo + val barRef: (Int, Any) -> Unit = ::bar +} diff --git a/compiler/testData/diagnostics/tests/callableReference/function/ambiguityTopLevelVsTopLevelGeneric.kt b/compiler/testData/diagnostics/tests/callableReference/function/ambiguityTopLevelVsTopLevelGeneric.kt new file mode 100644 index 00000000000..8843b686c60 --- /dev/null +++ b/compiler/testData/diagnostics/tests/callableReference/function/ambiguityTopLevelVsTopLevelGeneric.kt @@ -0,0 +1,8 @@ +fun foo(x: Int, y: Any): Int = x + +fun bar(x: T, y: Any): T = x + +fun main() { + val fooRef: (Int, Any) -> Unit = ::foo + val barRef: (Int, Any) -> Unit = ::bar +} diff --git a/compiler/testData/diagnostics/tests/callableReference/generic/expectedFunctionType.fir.kt b/compiler/testData/diagnostics/tests/callableReference/generic/expectedFunctionType.fir.kt index cc1dbb02c5c..1192d0b6489 100644 --- a/compiler/testData/diagnostics/tests/callableReference/generic/expectedFunctionType.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/generic/expectedFunctionType.fir.kt @@ -11,7 +11,7 @@ class A1 { class A2 { fun a2(key: K): V = TODO() - fun test1(): (String) -> Unit = A2()::a2 + fun test1(): (String) -> Unit = A2()::a2 fun test2(): (T3) -> T3 = A2()::a2 } @@ -19,7 +19,7 @@ class A3 { fun a3(key: T): V = TODO() fun test1(): (T) -> Int = this::a3 - fun test2(): (T) -> Unit = A3()::a3 + fun test2(): (T) -> Unit = A3()::a3 fun test3(): (Int) -> String = A3()::a3 fun test4(): (R) -> Unit = this::a3 diff --git a/compiler/testData/diagnostics/tests/inference/callableReferences/conversionLastStatementInLambdaGeneric.fir.kt b/compiler/testData/diagnostics/tests/inference/callableReferences/conversionLastStatementInLambdaGeneric.fir.kt new file mode 100644 index 00000000000..82ee0929932 --- /dev/null +++ b/compiler/testData/diagnostics/tests/inference/callableReferences/conversionLastStatementInLambdaGeneric.fir.kt @@ -0,0 +1,30 @@ +// DIAGNOSTICS: -UNCHECKED_CAST +// This test is a copy of conversionLastStatementInLambda, but with generic functions +// However works diffirently in K1 + +fun main(b: Boolean) { + callWithLambda { + ::test1 + } + + callWithLambda { + if (b) ::test1 else ::test2 + } + + callWithLambda { + if (b) { + ::test1 + } else { + ::test2 + } + } + + callWithLambda { + (::test1) + } +} + +fun test1(): T = "" as T +fun test2(): T = "" as T + +fun callWithLambda(action: () -> () -> Unit) {} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/callableReferences/conversionLastStatementInLambdaGeneric.kt b/compiler/testData/diagnostics/tests/inference/callableReferences/conversionLastStatementInLambdaGeneric.kt new file mode 100644 index 00000000000..b686c9e2a09 --- /dev/null +++ b/compiler/testData/diagnostics/tests/inference/callableReferences/conversionLastStatementInLambdaGeneric.kt @@ -0,0 +1,30 @@ +// DIAGNOSTICS: -UNCHECKED_CAST +// This test is a copy of conversionLastStatementInLambda, but with generic functions +// However works diffirently in K1 + +fun main(b: Boolean) { + callWithLambda { + ::test1 + } + + callWithLambda { + if (b) ::test1 else ::test2 + } + + callWithLambda { + if (b) { + ::test1 + } else { + ::test2 + } + } + + callWithLambda { + (::test1) + } +} + +fun test1(): T = "" as T +fun test2(): T = "" as T + +fun callWithLambda(action: () -> () -> Unit) {} diff --git a/compiler/testData/diagnostics/tests/inference/coercionToUnit/genericInApply.kt b/compiler/testData/diagnostics/tests/inference/coercionToUnit/genericInApply.kt new file mode 100644 index 00000000000..fe8e78fe5d3 --- /dev/null +++ b/compiler/testData/diagnostics/tests/inference/coercionToUnit/genericInApply.kt @@ -0,0 +1,10 @@ +// FIR_IDENTICAL +// WITH_STDLIB + +fun addNumber(n: N) = n + +fun foo() = 42 + +fun test() { + foo().apply(::addNumber) +} diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java index 6bbc8b19137..17605b22d17 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java @@ -4833,6 +4833,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/callableReference/function/ambiguityTopLevelVsTopLevel.kt"); } + @Test + @TestMetadata("ambiguityTopLevelVsTopLevelGeneric.kt") + public void testAmbiguityTopLevelVsTopLevelGeneric() throws Exception { + runTest("compiler/testData/diagnostics/tests/callableReference/function/ambiguityTopLevelVsTopLevelGeneric.kt"); + } + @Test @TestMetadata("annotationClassConstructor.kt") public void testAnnotationClassConstructor() throws Exception { @@ -17463,6 +17469,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/inference/callableReferences/conversionLastStatementInLambda.kt"); } + @Test + @TestMetadata("conversionLastStatementInLambdaGeneric.kt") + public void testConversionLastStatementInLambdaGeneric() throws Exception { + runTest("compiler/testData/diagnostics/tests/inference/callableReferences/conversionLastStatementInLambdaGeneric.kt"); + } + @Test @TestMetadata("kt55931.kt") public void testKt55931() throws Exception { @@ -17825,6 +17837,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/inference/coercionToUnit/coersionWithAnonymousFunctionsAndUnresolved.kt"); } + @Test + @TestMetadata("genericInApply.kt") + public void testGenericInApply() throws Exception { + runTest("compiler/testData/diagnostics/tests/inference/coercionToUnit/genericInApply.kt"); + } + @Test @TestMetadata("indirectCoercionWithExpectedType.kt") public void testIndirectCoercionWithExpectedType() throws Exception {