From 2bb9838a80b8ad5d51b7ccde409af9cfb8482bf0 Mon Sep 17 00:00:00 2001 From: Mikhail Zarechenskiy Date: Wed, 8 Jul 2020 15:30:15 +0300 Subject: [PATCH] Add test for obsolete issue The problem was fixed in d51bb2c05398ee116c7453c1c4fedc6daded5a7a #KT-37692 Obsolete --- ...irOldFrontendDiagnosticsTestGenerated.java | 5 +++++ .../resolve/overloadConflicts/kt37692.fir.kt | 14 +++++++++++++ .../resolve/overloadConflicts/kt37692.kt | 14 +++++++++++++ .../resolve/overloadConflicts/kt37692.txt | 20 +++++++++++++++++++ .../checkers/DiagnosticsTestGenerated.java | 5 +++++ .../DiagnosticsUsingJavacTestGenerated.java | 5 +++++ 6 files changed, 63 insertions(+) create mode 100644 compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt37692.fir.kt create mode 100644 compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt37692.kt create mode 100644 compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt37692.txt 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 6b0a49e0c07..435d3fd27d8 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 @@ -19501,6 +19501,11 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirOldFronte runTest("compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt31758_compat.kt"); } + @TestMetadata("kt37692.kt") + public void testKt37692() throws Exception { + runTest("compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt37692.kt"); + } + @TestMetadata("numberOfDefaults.kt") public void testNumberOfDefaults() throws Exception { runTest("compiler/testData/diagnostics/tests/resolve/overloadConflicts/numberOfDefaults.kt"); diff --git a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt37692.fir.kt b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt37692.fir.kt new file mode 100644 index 00000000000..3549720cd66 --- /dev/null +++ b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt37692.fir.kt @@ -0,0 +1,14 @@ +// !DIAGNOSTICS: -UNUSED_PARAMETER + +abstract class Bar + +class Foo : Bar(), Comparable> { + override fun compareTo(other: Foo<*>): Int = TODO() +} + +infix fun , S : T?> Bar.test(t: T) { } +infix fun , S : T?> Bar.test(other: Bar) {} + +fun checkFunctions(exp1: Foo, exp2: Foo) { + exp1.test(exp2) +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt37692.kt b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt37692.kt new file mode 100644 index 00000000000..c5380625e81 --- /dev/null +++ b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt37692.kt @@ -0,0 +1,14 @@ +// !DIAGNOSTICS: -UNUSED_PARAMETER + +abstract class Bar + +class Foo : Bar(), Comparable> { + override fun compareTo(other: Foo<*>): Int = TODO() +} + +infix fun , S : T?> Bar.test(t: T) { } +infix fun , S : T?> Bar.test(other: Bar) {} + +fun checkFunctions(exp1: Foo, exp2: Foo) { + exp1.test(exp2) +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt37692.txt b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt37692.txt new file mode 100644 index 00000000000..02987b542a9 --- /dev/null +++ b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt37692.txt @@ -0,0 +1,20 @@ +package + +public fun checkFunctions(/*0*/ exp1: Foo, /*1*/ exp2: Foo): kotlin.Unit +public infix fun , /*1*/ S : T?> Bar.test(/*0*/ other: Bar): kotlin.Unit +public infix fun , /*1*/ S : T?> Bar.test(/*0*/ t: T): kotlin.Unit + +public abstract class Bar { + public constructor Bar() + 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 final class Foo : Bar, kotlin.Comparable> { + public constructor Foo() + public open override /*1*/ fun compareTo(/*0*/ other: Foo<*>): 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/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java index 596171697df..81b6595f0d8 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java @@ -19513,6 +19513,11 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTestWithFirVali runTest("compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt31758_compat.kt"); } + @TestMetadata("kt37692.kt") + public void testKt37692() throws Exception { + runTest("compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt37692.kt"); + } + @TestMetadata("numberOfDefaults.kt") public void testNumberOfDefaults() throws Exception { runTest("compiler/testData/diagnostics/tests/resolve/overloadConflicts/numberOfDefaults.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java index 071e63415ff..d0bab057a69 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java @@ -19503,6 +19503,11 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing runTest("compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt31758_compat.kt"); } + @TestMetadata("kt37692.kt") + public void testKt37692() throws Exception { + runTest("compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt37692.kt"); + } + @TestMetadata("numberOfDefaults.kt") public void testNumberOfDefaults() throws Exception { runTest("compiler/testData/diagnostics/tests/resolve/overloadConflicts/numberOfDefaults.kt");