diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java index b588925995f..7e58f9a1841 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java @@ -15433,6 +15433,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti runTest("compiler/testData/diagnostics/tests/inference/emptyIntersectionTypes/kt49661.kt"); } + @Test + @TestMetadata("kt51016.kt") + public void testKt51016() throws Exception { + runTest("compiler/testData/diagnostics/tests/inference/emptyIntersectionTypes/kt51016.kt"); + } + @Test @TestMetadata("nullableEmptyIntersection.kt") public void testNullableEmptyIntersection() throws Exception { diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java index 2e831ba703b..ae1b31204ca 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java @@ -15433,6 +15433,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac runTest("compiler/testData/diagnostics/tests/inference/emptyIntersectionTypes/kt49661.kt"); } + @Test + @TestMetadata("kt51016.kt") + public void testKt51016() throws Exception { + runTest("compiler/testData/diagnostics/tests/inference/emptyIntersectionTypes/kt51016.kt"); + } + @Test @TestMetadata("nullableEmptyIntersection.kt") public void testNullableEmptyIntersection() throws Exception { diff --git a/compiler/testData/diagnostics/tests/inference/emptyIntersectionTypes/kt51016.fir.kt b/compiler/testData/diagnostics/tests/inference/emptyIntersectionTypes/kt51016.fir.kt new file mode 100644 index 00000000000..57e9d0eab0c --- /dev/null +++ b/compiler/testData/diagnostics/tests/inference/emptyIntersectionTypes/kt51016.fir.kt @@ -0,0 +1,11 @@ +interface A +interface B : A + +fun , S : T?> B.foo(t: T) {} +fun , S : T?> A.foo(other: A) {} + +interface C : B, Comparable> + +fun test(x: C) { + x.foo(x) // OVERLOAD_RESOLUTION_AMBIGUITY, shoub be OK +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/emptyIntersectionTypes/kt51016.kt b/compiler/testData/diagnostics/tests/inference/emptyIntersectionTypes/kt51016.kt new file mode 100644 index 00000000000..d60d080cff1 --- /dev/null +++ b/compiler/testData/diagnostics/tests/inference/emptyIntersectionTypes/kt51016.kt @@ -0,0 +1,11 @@ +interface A +interface B : A + +fun , S : T?> B.foo(t: T) {} +fun , S : T?> A.foo(other: A) {} + +interface C : B, Comparable> + +fun test(x: C) { + x.foo(x) // OVERLOAD_RESOLUTION_AMBIGUITY, shoub be OK +} diff --git a/compiler/testData/diagnostics/tests/inference/emptyIntersectionTypes/kt51016.txt b/compiler/testData/diagnostics/tests/inference/emptyIntersectionTypes/kt51016.txt new file mode 100644 index 00000000000..72fb98b8b1f --- /dev/null +++ b/compiler/testData/diagnostics/tests/inference/emptyIntersectionTypes/kt51016.txt @@ -0,0 +1,24 @@ +package + +public fun test(/*0*/ x: C): kotlin.Unit +public fun , /*1*/ S : T?> A.foo(/*0*/ other: A): kotlin.Unit +public fun , /*1*/ S : T?> B.foo(/*0*/ t: T): kotlin.Unit + +public interface 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 interface B : 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 interface C : B, kotlin.Comparable> { + public abstract override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: C<*>): kotlin.Int + public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String +} 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 d9ccd8c7fad..bbce687e669 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 @@ -15439,6 +15439,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/inference/emptyIntersectionTypes/kt49661.kt"); } + @Test + @TestMetadata("kt51016.kt") + public void testKt51016() throws Exception { + runTest("compiler/testData/diagnostics/tests/inference/emptyIntersectionTypes/kt51016.kt"); + } + @Test @TestMetadata("nullableEmptyIntersection.kt") public void testNullableEmptyIntersection() throws Exception {