[tests] Add tests for conflicting overloads + hidden between open/final

This commit is contained in:
marat.akhin
2023-11-21 18:04:35 +01:00
committed by Space Team
parent 83abbe8a78
commit f0f06ccf2e
11 changed files with 204 additions and 0 deletions
@@ -27207,6 +27207,18 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/overload/noConflictingOverloadsWithDeprecatedHidden"), Pattern.compile("^(.+)\\.(kt|kts)$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true);
}
@Test
@TestMetadata("ConflictingOverloadsFunsDifferentReturnInClass.kt")
public void testConflictingOverloadsFunsDifferentReturnInClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/overload/noConflictingOverloadsWithDeprecatedHidden/ConflictingOverloadsFunsDifferentReturnInClass.kt");
}
@Test
@TestMetadata("ConflictingOverloadsIdenticalFunsInClass.kt")
public void testConflictingOverloadsIdenticalFunsInClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/overload/noConflictingOverloadsWithDeprecatedHidden/ConflictingOverloadsIdenticalFunsInClass.kt");
}
@Test
@TestMetadata("ConflictingOverloadsIdenticalValsInClass.kt")
public void testConflictingOverloadsIdenticalValsInClass() throws Exception {
@@ -27207,6 +27207,18 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/overload/noConflictingOverloadsWithDeprecatedHidden"), Pattern.compile("^(.+)\\.(kt|kts)$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true);
}
@Test
@TestMetadata("ConflictingOverloadsFunsDifferentReturnInClass.kt")
public void testConflictingOverloadsFunsDifferentReturnInClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/overload/noConflictingOverloadsWithDeprecatedHidden/ConflictingOverloadsFunsDifferentReturnInClass.kt");
}
@Test
@TestMetadata("ConflictingOverloadsIdenticalFunsInClass.kt")
public void testConflictingOverloadsIdenticalFunsInClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/overload/noConflictingOverloadsWithDeprecatedHidden/ConflictingOverloadsIdenticalFunsInClass.kt");
}
@Test
@TestMetadata("ConflictingOverloadsIdenticalValsInClass.kt")
public void testConflictingOverloadsIdenticalValsInClass() throws Exception {
@@ -25141,6 +25141,18 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/overload/noConflictingOverloadsWithDeprecatedHidden"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true, "multiplatform");
}
@Test
@TestMetadata("ConflictingOverloadsFunsDifferentReturnInClass.kt")
public void testConflictingOverloadsFunsDifferentReturnInClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/overload/noConflictingOverloadsWithDeprecatedHidden/ConflictingOverloadsFunsDifferentReturnInClass.kt");
}
@Test
@TestMetadata("ConflictingOverloadsIdenticalFunsInClass.kt")
public void testConflictingOverloadsIdenticalFunsInClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/overload/noConflictingOverloadsWithDeprecatedHidden/ConflictingOverloadsIdenticalFunsInClass.kt");
}
@Test
@TestMetadata("ConflictingOverloadsIdenticalValsInClass.kt")
public void testConflictingOverloadsIdenticalValsInClass() throws Exception {
@@ -25147,6 +25147,18 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/overload/noConflictingOverloadsWithDeprecatedHidden"), Pattern.compile("^(.*)\\.kts?$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true, "multiplatform");
}
@Test
@TestMetadata("ConflictingOverloadsFunsDifferentReturnInClass.kt")
public void testConflictingOverloadsFunsDifferentReturnInClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/overload/noConflictingOverloadsWithDeprecatedHidden/ConflictingOverloadsFunsDifferentReturnInClass.kt");
}
@Test
@TestMetadata("ConflictingOverloadsIdenticalFunsInClass.kt")
public void testConflictingOverloadsIdenticalFunsInClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/overload/noConflictingOverloadsWithDeprecatedHidden/ConflictingOverloadsIdenticalFunsInClass.kt");
}
@Test
@TestMetadata("ConflictingOverloadsIdenticalValsInClass.kt")
public void testConflictingOverloadsIdenticalValsInClass() throws Exception {
@@ -0,0 +1,20 @@
class A {
fun a(a: Int): Int = 0
@Deprecated("a", level = DeprecationLevel.HIDDEN) fun a(a: Int) {
}
}
open class B {
<!CONFLICTING_OVERLOADS!>open fun a(a: Int): Int<!> = 0
<!CONFLICTING_OVERLOADS!>@Deprecated("a", level = DeprecationLevel.HIDDEN) fun a(a: Int)<!> {
}
}
open class C {
<!CONFLICTING_OVERLOADS!>fun a(a: Int): Int<!> = 0
<!CONFLICTING_OVERLOADS!>@Deprecated("a", level = DeprecationLevel.HIDDEN) open fun a(a: Int)<!> {
}
}
@@ -0,0 +1,20 @@
class A {
<!CONFLICTING_OVERLOADS!>fun a(a: Int): Int<!> = 0
<!CONFLICTING_OVERLOADS!>@Deprecated("a", level = DeprecationLevel.HIDDEN) fun a(a: Int)<!> {
}
}
open class B {
<!CONFLICTING_OVERLOADS!>open fun a(a: Int): Int<!> = 0
<!CONFLICTING_OVERLOADS!>@Deprecated("a", level = DeprecationLevel.HIDDEN) fun a(a: Int)<!> {
}
}
open class C {
<!CONFLICTING_OVERLOADS!>fun a(a: Int): Int<!> = 0
<!CONFLICTING_OVERLOADS!>@Deprecated("a", level = DeprecationLevel.HIDDEN) open fun a(a: Int)<!> {
}
}
@@ -0,0 +1,29 @@
package
public final class A {
public constructor A()
@kotlin.Deprecated(level = DeprecationLevel.HIDDEN, message = "a") public final fun a(/*0*/ a: kotlin.Int): kotlin.Unit
public final fun a(/*0*/ a: kotlin.Int): kotlin.Int
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 open class B {
public constructor B()
@kotlin.Deprecated(level = DeprecationLevel.HIDDEN, message = "a") public final fun a(/*0*/ a: kotlin.Int): kotlin.Unit
public open fun a(/*0*/ a: kotlin.Int): kotlin.Int
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 open class C {
public constructor C()
@kotlin.Deprecated(level = DeprecationLevel.HIDDEN, message = "a") public open fun a(/*0*/ a: kotlin.Int): kotlin.Unit
public final fun a(/*0*/ a: kotlin.Int): kotlin.Int
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
}
@@ -0,0 +1,23 @@
class A() {
fun b() {
}
@Deprecated("a", level = DeprecationLevel.HIDDEN) fun b() {
}
}
open class B() {
<!CONFLICTING_OVERLOADS!>open fun b()<!> {
}
<!CONFLICTING_OVERLOADS!>@Deprecated("a", level = DeprecationLevel.HIDDEN) fun b()<!> {
}
}
open class C() {
<!CONFLICTING_OVERLOADS!>fun b()<!> {
}
<!CONFLICTING_OVERLOADS!>@Deprecated("a", level = DeprecationLevel.HIDDEN) open fun b()<!> {
}
}
@@ -0,0 +1,23 @@
class A() {
<!CONFLICTING_OVERLOADS!>fun b()<!> {
}
<!CONFLICTING_OVERLOADS!>@Deprecated("a", level = DeprecationLevel.HIDDEN) fun b()<!> {
}
}
open class B() {
<!CONFLICTING_OVERLOADS!>open fun b()<!> {
}
<!CONFLICTING_OVERLOADS!>@Deprecated("a", level = DeprecationLevel.HIDDEN) fun b()<!> {
}
}
open class C() {
<!CONFLICTING_OVERLOADS!>fun b()<!> {
}
<!CONFLICTING_OVERLOADS!>@Deprecated("a", level = DeprecationLevel.HIDDEN) open fun b()<!> {
}
}
@@ -0,0 +1,29 @@
package
public final class A {
public constructor A()
@kotlin.Deprecated(level = DeprecationLevel.HIDDEN, message = "a") public final fun b(): kotlin.Unit
public final fun b(): kotlin.Unit
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 open class B {
public constructor B()
@kotlin.Deprecated(level = DeprecationLevel.HIDDEN, message = "a") public final fun b(): kotlin.Unit
public open fun b(): kotlin.Unit
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 open class C {
public constructor C()
@kotlin.Deprecated(level = DeprecationLevel.HIDDEN, message = "a") public open fun b(): kotlin.Unit
public final fun b(): kotlin.Unit
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
}
@@ -27207,6 +27207,18 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/overload/noConflictingOverloadsWithDeprecatedHidden"), Pattern.compile("^(.*)\\.kts?$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true);
}
@Test
@TestMetadata("ConflictingOverloadsFunsDifferentReturnInClass.kt")
public void testConflictingOverloadsFunsDifferentReturnInClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/overload/noConflictingOverloadsWithDeprecatedHidden/ConflictingOverloadsFunsDifferentReturnInClass.kt");
}
@Test
@TestMetadata("ConflictingOverloadsIdenticalFunsInClass.kt")
public void testConflictingOverloadsIdenticalFunsInClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/overload/noConflictingOverloadsWithDeprecatedHidden/ConflictingOverloadsIdenticalFunsInClass.kt");
}
@Test
@TestMetadata("ConflictingOverloadsIdenticalValsInClass.kt")
public void testConflictingOverloadsIdenticalValsInClass() throws Exception {