From cba224b7b8c4f54d8414cb560639293269533f51 Mon Sep 17 00:00:00 2001 From: Victor Petukhov Date: Fri, 23 Jul 2021 16:25:03 +0300 Subject: [PATCH] Update spec black box tests --- .../FirDiagnosticTestSpecGenerated.java | 72 ++++++++++++++++++ .../inheritance/neg/13.exceptions.runtime.txt | 15 ---- .../inheritance/neg/14.exceptions.runtime.txt | 2 - .../inheritance/neg/15.exceptions.runtime.txt | 2 - .../inheritance/neg/16.exceptions.runtime.txt | 15 ---- .../inheritance/neg/17.exceptions.runtime.txt | 15 ---- .../inheritance/neg/18.exceptions.runtime.txt | 2 - .../inheritance/neg/19.exceptions.runtime.txt | 2 - .../objects/inheritance/neg/1.fir.kt} | 7 +- .../notLinked/objects/inheritance/neg/1.kt | 19 +++++ .../notLinked/objects/inheritance/neg/1.txt | 19 +++++ .../objects/inheritance/neg/2.fir.kt} | 7 +- .../notLinked/objects/inheritance/neg/2.kt | 19 +++++ .../notLinked/objects/inheritance/neg/2.txt | 19 +++++ .../objects/inheritance/neg/3.fir.kt} | 7 +- .../notLinked/objects/inheritance/neg/3.kt | 19 +++++ .../notLinked/objects/inheritance/neg/3.txt | 19 +++++ .../objects/inheritance/neg/4.fir.kt} | 7 +- .../notLinked/objects/inheritance/neg/4.kt | 19 +++++ .../notLinked/objects/inheritance/neg/4.txt | 19 +++++ .../objects/inheritance/neg/5.fir.kt} | 7 +- .../notLinked/objects/inheritance/neg/5.kt | 19 +++++ .../notLinked/objects/inheritance/neg/5.txt | 19 +++++ .../objects/inheritance/neg/6.fir.kt} | 7 +- .../notLinked/objects/inheritance/neg/6.kt | 19 +++++ .../notLinked/objects/inheritance/neg/6.txt | 19 +++++ .../objects/inheritance/neg/7.fir.kt} | 7 +- .../notLinked/objects/inheritance/neg/7.kt | 19 +++++ .../notLinked/objects/inheritance/neg/7.txt | 19 +++++ .../DiagnosticsTestSpecGenerated.java | 74 +++++++++++++++++++ .../BlackBoxCodegenTestSpecGenerated.java | 35 --------- .../compiler/based/FirIdeSpecTest.java | 72 ++++++++++++++++++ 32 files changed, 505 insertions(+), 116 deletions(-) delete mode 100644 compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/13.exceptions.runtime.txt delete mode 100644 compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/14.exceptions.runtime.txt delete mode 100644 compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/15.exceptions.runtime.txt delete mode 100644 compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/16.exceptions.runtime.txt delete mode 100644 compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/17.exceptions.runtime.txt delete mode 100644 compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/18.exceptions.runtime.txt delete mode 100644 compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/19.exceptions.runtime.txt rename compiler/tests-spec/testData/{codegen/box/notLinked/objects/inheritance/neg/16.kt => diagnostics/notLinked/objects/inheritance/neg/1.fir.kt} (72%) create mode 100644 compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/1.kt create mode 100644 compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/1.txt rename compiler/tests-spec/testData/{codegen/box/notLinked/objects/inheritance/neg/14.kt => diagnostics/notLinked/objects/inheritance/neg/2.fir.kt} (73%) create mode 100644 compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/2.kt create mode 100644 compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/2.txt rename compiler/tests-spec/testData/{codegen/box/notLinked/objects/inheritance/neg/15.kt => diagnostics/notLinked/objects/inheritance/neg/3.fir.kt} (72%) create mode 100644 compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/3.kt create mode 100644 compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/3.txt rename compiler/tests-spec/testData/{codegen/box/notLinked/objects/inheritance/neg/13.kt => diagnostics/notLinked/objects/inheritance/neg/4.fir.kt} (72%) create mode 100644 compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/4.kt create mode 100644 compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/4.txt rename compiler/tests-spec/testData/{codegen/box/notLinked/objects/inheritance/neg/17.kt => diagnostics/notLinked/objects/inheritance/neg/5.fir.kt} (72%) create mode 100644 compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/5.kt create mode 100644 compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/5.txt rename compiler/tests-spec/testData/{codegen/box/notLinked/objects/inheritance/neg/18.kt => diagnostics/notLinked/objects/inheritance/neg/6.fir.kt} (72%) create mode 100644 compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/6.kt create mode 100644 compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/6.txt rename compiler/tests-spec/testData/{codegen/box/notLinked/objects/inheritance/neg/19.kt => diagnostics/notLinked/objects/inheritance/neg/7.fir.kt} (72%) create mode 100644 compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/7.kt create mode 100644 compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/7.txt diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticTestSpecGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticTestSpecGenerated.java index f9d25f9c728..2abfe090381 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticTestSpecGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticTestSpecGenerated.java @@ -7483,6 +7483,78 @@ public class FirDiagnosticTestSpecGenerated extends AbstractFirDiagnosticTestSpe } } + @Nested + @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/objects") + @TestDataPath("$PROJECT_ROOT") + public class Objects { + @Test + public void testAllFilesPresentInObjects() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/objects"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + + @Nested + @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance") + @TestDataPath("$PROJECT_ROOT") + public class Inheritance { + @Test + public void testAllFilesPresentInInheritance() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + + @Nested + @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg") + @TestDataPath("$PROJECT_ROOT") + public class Neg { + @Test + @TestMetadata("1.kt") + public void test1() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/1.kt"); + } + + @Test + @TestMetadata("2.kt") + public void test2() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/2.kt"); + } + + @Test + @TestMetadata("3.kt") + public void test3() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/3.kt"); + } + + @Test + @TestMetadata("4.kt") + public void test4() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/4.kt"); + } + + @Test + @TestMetadata("5.kt") + public void test5() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/5.kt"); + } + + @Test + @TestMetadata("6.kt") + public void test6() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/6.kt"); + } + + @Test + @TestMetadata("7.kt") + public void test7() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/7.kt"); + } + + @Test + public void testAllFilesPresentInNeg() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + } + } + } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/overload-resolution") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/13.exceptions.runtime.txt b/compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/13.exceptions.runtime.txt deleted file mode 100644 index c6e71711d2c..00000000000 --- a/compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/13.exceptions.runtime.txt +++ /dev/null @@ -1,15 +0,0 @@ -java.lang.VerifyError: Bad type on operand stack -Exception Details: - Location: - Foo$Companion.()V @2: checkcast - Reason: - Type uninitializedThis (current frame, stack[1]) is not assignable to 'java/lang/Object' - Current Frame: - bci: @2 - flags: { flagThisUninit } - locals: { uninitializedThis } - stack: { uninitializedThis, uninitializedThis } - Bytecode: - 0x0000000: 2a2a c000 02b6 000a b700 0db1 - -Foo.(13.kt) \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/14.exceptions.runtime.txt b/compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/14.exceptions.runtime.txt deleted file mode 100644 index 229f676b1d4..00000000000 --- a/compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/14.exceptions.runtime.txt +++ /dev/null @@ -1,2 +0,0 @@ -java.lang.ExceptionInInitializerError -_14Kt.box(14.kt:17) \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/15.exceptions.runtime.txt b/compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/15.exceptions.runtime.txt deleted file mode 100644 index c488c137a91..00000000000 --- a/compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/15.exceptions.runtime.txt +++ /dev/null @@ -1,2 +0,0 @@ -java.lang.ExceptionInInitializerError -_15Kt.box(15.kt:17) \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/16.exceptions.runtime.txt b/compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/16.exceptions.runtime.txt deleted file mode 100644 index 7099f46139e..00000000000 --- a/compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/16.exceptions.runtime.txt +++ /dev/null @@ -1,15 +0,0 @@ -java.lang.VerifyError: Bad type on operand stack -Exception Details: - Location: - Foo$Companion.()V @2: checkcast - Reason: - Type uninitializedThis (current frame, stack[1]) is not assignable to 'java/lang/Object' - Current Frame: - bci: @2 - flags: { flagThisUninit } - locals: { uninitializedThis } - stack: { uninitializedThis, uninitializedThis } - Bytecode: - 0x0000000: 2a2a c000 02b6 000a b700 0db1 - -Foo.(16.kt) \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/17.exceptions.runtime.txt b/compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/17.exceptions.runtime.txt deleted file mode 100644 index 7fe0d2bfc7a..00000000000 --- a/compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/17.exceptions.runtime.txt +++ /dev/null @@ -1,15 +0,0 @@ -java.lang.VerifyError: Bad type on operand stack -Exception Details: - Location: - Foo$Companion.()V @2: checkcast - Reason: - Type uninitializedThis (current frame, stack[1]) is not assignable to 'java/lang/Object' - Current Frame: - bci: @2 - flags: { flagThisUninit } - locals: { uninitializedThis } - stack: { uninitializedThis, uninitializedThis } - Bytecode: - 0x0000000: 2a2a c000 02b6 000a b700 0db1 - -Foo.(17.kt) \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/18.exceptions.runtime.txt b/compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/18.exceptions.runtime.txt deleted file mode 100644 index a9308a0e46e..00000000000 --- a/compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/18.exceptions.runtime.txt +++ /dev/null @@ -1,2 +0,0 @@ -java.lang.ExceptionInInitializerError -_18Kt.box(18.kt:17) \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/19.exceptions.runtime.txt b/compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/19.exceptions.runtime.txt deleted file mode 100644 index d7fd5c129a9..00000000000 --- a/compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/19.exceptions.runtime.txt +++ /dev/null @@ -1,2 +0,0 @@ -java.lang.ExceptionInInitializerError -_19Kt.box(19.kt:17) \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/16.kt b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/1.fir.kt similarity index 72% rename from compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/16.kt rename to compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/1.fir.kt index d67383185fd..1fe86679d4d 100644 --- a/compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/16.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/1.fir.kt @@ -1,14 +1,13 @@ /* - * KOTLIN CODEGEN BOX NOT LINKED SPEC TEST (NEGATIVE) + * KOTLIN DIAGNOSTICS NOT LINKED SPEC TEST (NEGATIVE) * * SECTIONS: objects, inheritance - * NUMBER: 16 + * NUMBER: 1 * DESCRIPTION: Access to class members in the super constructor call of an object. - * UNEXPECTED BEHAVIOUR * ISSUES: KT-25289 - * EXCEPTION: runtime */ +// TESTCASE NUMBER: 1 open class Foo(val prop: Int) { companion object : Foo(prop) } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/1.kt b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/1.kt new file mode 100644 index 00000000000..c406e0c1007 --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/1.kt @@ -0,0 +1,19 @@ +/* + * KOTLIN DIAGNOSTICS NOT LINKED SPEC TEST (NEGATIVE) + * + * SECTIONS: objects, inheritance + * NUMBER: 1 + * DESCRIPTION: Access to class members in the super constructor call of an object. + * ISSUES: KT-25289 + */ + +// TESTCASE NUMBER: 1 +open class Foo(val prop: Int) { + companion object : Foo(prop) +} + +fun box(): String? { + if (Foo(42) == null) return null + + return "OK" +} diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/1.txt b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/1.txt new file mode 100644 index 00000000000..4b1f498a4bd --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/1.txt @@ -0,0 +1,19 @@ +package + +public fun box(): kotlin.String? + +public open class Foo { + public constructor Foo(/*0*/ prop: kotlin.Int) + public final val prop: 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 companion object Companion : Foo { + private constructor Companion() + public final override /*1*/ /*fake_override*/ val prop: 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 + } +} diff --git a/compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/14.kt b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/2.fir.kt similarity index 73% rename from compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/14.kt rename to compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/2.fir.kt index 944af498b98..0be19b01ed4 100644 --- a/compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/14.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/2.fir.kt @@ -1,14 +1,13 @@ /* - * KOTLIN CODEGEN BOX NOT LINKED SPEC TEST (NEGATIVE) + * KOTLIN DIAGNOSTICS NOT LINKED SPEC TEST (NEGATIVE) * * SECTIONS: objects, inheritance - * NUMBER: 14 + * NUMBER: 2 * DESCRIPTION: Access to class members in the super constructor call of an object. - * UNEXPECTED BEHAVIOUR * ISSUES: KT-25289 - * EXCEPTION: runtime */ +// TESTCASE NUMBER: 2 open class Foo(val prop: Int) { companion object MyCompanion : Foo(Foo.prop) } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/2.kt b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/2.kt new file mode 100644 index 00000000000..67c8063aa33 --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/2.kt @@ -0,0 +1,19 @@ +/* + * KOTLIN DIAGNOSTICS NOT LINKED SPEC TEST (NEGATIVE) + * + * SECTIONS: objects, inheritance + * NUMBER: 2 + * DESCRIPTION: Access to class members in the super constructor call of an object. + * ISSUES: KT-25289 + */ + +// TESTCASE NUMBER: 2 +open class Foo(val prop: Int) { + companion object MyCompanion : Foo(Foo.prop) +} + +fun box(): String? { + if (Foo(42) == null) return null + + return "OK" +} diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/2.txt b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/2.txt new file mode 100644 index 00000000000..660ee327f09 --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/2.txt @@ -0,0 +1,19 @@ +package + +public fun box(): kotlin.String? + +public open class Foo { + public constructor Foo(/*0*/ prop: kotlin.Int) + public final val prop: 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 companion object MyCompanion : Foo { + private constructor MyCompanion() + public final override /*1*/ /*fake_override*/ val prop: 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 + } +} diff --git a/compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/15.kt b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/3.fir.kt similarity index 72% rename from compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/15.kt rename to compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/3.fir.kt index 8d4c97af213..09a8c23e326 100644 --- a/compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/15.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/3.fir.kt @@ -1,14 +1,13 @@ /* - * KOTLIN CODEGEN BOX NOT LINKED SPEC TEST (NEGATIVE) + * KOTLIN DIAGNOSTICS NOT LINKED SPEC TEST (NEGATIVE) * * SECTIONS: objects, inheritance - * NUMBER: 15 + * NUMBER: 3 * DESCRIPTION: Access to class members in the super constructor call of an object. - * UNEXPECTED BEHAVIOUR * ISSUES: KT-25289 - * EXCEPTION: runtime */ +// TESTCASE NUMBER: 3 open class Foo(val prop: Int) { object MyObject : Foo(MyObject.prop) } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/3.kt b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/3.kt new file mode 100644 index 00000000000..ec14167f163 --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/3.kt @@ -0,0 +1,19 @@ +/* + * KOTLIN DIAGNOSTICS NOT LINKED SPEC TEST (NEGATIVE) + * + * SECTIONS: objects, inheritance + * NUMBER: 3 + * DESCRIPTION: Access to class members in the super constructor call of an object. + * ISSUES: KT-25289 + */ + +// TESTCASE NUMBER: 3 +open class Foo(val prop: Int) { + object MyObject : Foo(MyObject.prop) +} + +fun box(): String? { + if (Foo.MyObject == null) return null + + return "OK" +} diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/3.txt b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/3.txt new file mode 100644 index 00000000000..6d8892b3498 --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/3.txt @@ -0,0 +1,19 @@ +package + +public fun box(): kotlin.String? + +public open class Foo { + public constructor Foo(/*0*/ prop: kotlin.Int) + public final val prop: 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 object MyObject : Foo { + private constructor MyObject() + public final override /*1*/ /*fake_override*/ val prop: 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 + } +} diff --git a/compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/13.kt b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/4.fir.kt similarity index 72% rename from compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/13.kt rename to compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/4.fir.kt index a7c1e411bc1..e52c3776eef 100644 --- a/compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/13.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/4.fir.kt @@ -1,14 +1,13 @@ /* - * KOTLIN CODEGEN BOX NOT LINKED SPEC TEST (NEGATIVE) + * KOTLIN DIAGNOSTICS NOT LINKED SPEC TEST (NEGATIVE) * * SECTIONS: objects, inheritance - * NUMBER: 13 + * NUMBER: 4 * DESCRIPTION: Access to class members in the super constructor call of an object. - * UNEXPECTED BEHAVIOUR * ISSUES: KT-25289 - * EXCEPTION: runtime */ +// TESTCASE NUMBER: 4 open class Foo(val prop: Int) { companion object : Foo(prop) } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/4.kt b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/4.kt new file mode 100644 index 00000000000..cdf9e43b058 --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/4.kt @@ -0,0 +1,19 @@ +/* + * KOTLIN DIAGNOSTICS NOT LINKED SPEC TEST (NEGATIVE) + * + * SECTIONS: objects, inheritance + * NUMBER: 4 + * DESCRIPTION: Access to class members in the super constructor call of an object. + * ISSUES: KT-25289 + */ + +// TESTCASE NUMBER: 4 +open class Foo(val prop: Int) { + companion object : Foo(prop) +} + +fun box(): String? { + if (Foo(42) == null) return null + + return "OK" +} diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/4.txt b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/4.txt new file mode 100644 index 00000000000..4b1f498a4bd --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/4.txt @@ -0,0 +1,19 @@ +package + +public fun box(): kotlin.String? + +public open class Foo { + public constructor Foo(/*0*/ prop: kotlin.Int) + public final val prop: 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 companion object Companion : Foo { + private constructor Companion() + public final override /*1*/ /*fake_override*/ val prop: 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 + } +} diff --git a/compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/17.kt b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/5.fir.kt similarity index 72% rename from compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/17.kt rename to compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/5.fir.kt index 03a4f5e3bdb..e303c89ce00 100644 --- a/compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/17.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/5.fir.kt @@ -1,14 +1,13 @@ /* - * KOTLIN CODEGEN BOX NOT LINKED SPEC TEST (NEGATIVE) + * KOTLIN DIAGNOSTICS NOT LINKED SPEC TEST (NEGATIVE) * * SECTIONS: objects, inheritance - * NUMBER: 17 + * NUMBER: 5 * DESCRIPTION: Access to class members in the super constructor call of an object. - * UNEXPECTED BEHAVIOUR * ISSUES: KT-25289 - * EXCEPTION: runtime */ +// TESTCASE NUMBER: 5 open class Foo(val prop: Int) { companion object : Foo(this.prop) } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/5.kt b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/5.kt new file mode 100644 index 00000000000..893f7174d6a --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/5.kt @@ -0,0 +1,19 @@ +/* + * KOTLIN DIAGNOSTICS NOT LINKED SPEC TEST (NEGATIVE) + * + * SECTIONS: objects, inheritance + * NUMBER: 5 + * DESCRIPTION: Access to class members in the super constructor call of an object. + * ISSUES: KT-25289 + */ + +// TESTCASE NUMBER: 5 +open class Foo(val prop: Int) { + companion object : Foo(this.prop) +} + +fun box(): String? { + if (Foo(42) == null) return null + + return "OK" +} diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/5.txt b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/5.txt new file mode 100644 index 00000000000..4b1f498a4bd --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/5.txt @@ -0,0 +1,19 @@ +package + +public fun box(): kotlin.String? + +public open class Foo { + public constructor Foo(/*0*/ prop: kotlin.Int) + public final val prop: 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 companion object Companion : Foo { + private constructor Companion() + public final override /*1*/ /*fake_override*/ val prop: 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 + } +} diff --git a/compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/18.kt b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/6.fir.kt similarity index 72% rename from compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/18.kt rename to compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/6.fir.kt index b25612b44fa..456d1f5f74f 100644 --- a/compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/18.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/6.fir.kt @@ -1,14 +1,13 @@ /* - * KOTLIN CODEGEN BOX NOT LINKED SPEC TEST (NEGATIVE) + * KOTLIN DIAGNOSTICS NOT LINKED SPEC TEST (NEGATIVE) * * SECTIONS: objects, inheritance - * NUMBER: 18 + * NUMBER: 6 * DESCRIPTION: Access to class members in the super constructor call of an object. - * UNEXPECTED BEHAVIOUR * ISSUES: KT-25289 - * EXCEPTION: runtime */ +// TESTCASE NUMBER: 6 open class Foo(val prop: Int) { companion object : Foo(Companion.prop) } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/6.kt b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/6.kt new file mode 100644 index 00000000000..0268eebe57b --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/6.kt @@ -0,0 +1,19 @@ +/* + * KOTLIN DIAGNOSTICS NOT LINKED SPEC TEST (NEGATIVE) + * + * SECTIONS: objects, inheritance + * NUMBER: 6 + * DESCRIPTION: Access to class members in the super constructor call of an object. + * ISSUES: KT-25289 + */ + +// TESTCASE NUMBER: 6 +open class Foo(val prop: Int) { + companion object : Foo(Companion.prop) +} + +fun box(): String? { + if (Foo(42) == null) return null + + return "OK" +} diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/6.txt b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/6.txt new file mode 100644 index 00000000000..4b1f498a4bd --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/6.txt @@ -0,0 +1,19 @@ +package + +public fun box(): kotlin.String? + +public open class Foo { + public constructor Foo(/*0*/ prop: kotlin.Int) + public final val prop: 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 companion object Companion : Foo { + private constructor Companion() + public final override /*1*/ /*fake_override*/ val prop: 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 + } +} diff --git a/compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/19.kt b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/7.fir.kt similarity index 72% rename from compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/19.kt rename to compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/7.fir.kt index 09bdb63376f..36195c7bd28 100644 --- a/compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/19.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/7.fir.kt @@ -1,14 +1,13 @@ /* - * KOTLIN CODEGEN BOX NOT LINKED SPEC TEST (NEGATIVE) + * KOTLIN DIAGNOSTICS NOT LINKED SPEC TEST (NEGATIVE) * * SECTIONS: objects, inheritance - * NUMBER: 19 + * NUMBER: 7 * DESCRIPTION: Access to class members in the super constructor call of an object. - * UNEXPECTED BEHAVIOUR * ISSUES: KT-25289 - * EXCEPTION: runtime */ +// TESTCASE NUMBER: 7 open class Foo(val prop: Int) { object MyObject : Foo(MyObject.prop) } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/7.kt b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/7.kt new file mode 100644 index 00000000000..aeba95b3e0a --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/7.kt @@ -0,0 +1,19 @@ +/* + * KOTLIN DIAGNOSTICS NOT LINKED SPEC TEST (NEGATIVE) + * + * SECTIONS: objects, inheritance + * NUMBER: 7 + * DESCRIPTION: Access to class members in the super constructor call of an object. + * ISSUES: KT-25289 + */ + +// TESTCASE NUMBER: 7 +open class Foo(val prop: Int) { + object MyObject : Foo(MyObject.prop) +} + +fun box(): String? { + if (Foo.MyObject == null) return null + + return "OK" +} diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/7.txt b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/7.txt new file mode 100644 index 00000000000..6d8892b3498 --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/7.txt @@ -0,0 +1,19 @@ +package + +public fun box(): kotlin.String? + +public open class Foo { + public constructor Foo(/*0*/ prop: kotlin.Int) + public final val prop: 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 object MyObject : Foo { + private constructor MyObject() + public final override /*1*/ /*fake_override*/ val prop: 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 + } +} diff --git a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/checkers/DiagnosticsTestSpecGenerated.java b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/checkers/DiagnosticsTestSpecGenerated.java index e576e6dc3e5..4b38a1457bc 100644 --- a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/checkers/DiagnosticsTestSpecGenerated.java +++ b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/checkers/DiagnosticsTestSpecGenerated.java @@ -7962,6 +7962,80 @@ public class DiagnosticsTestSpecGenerated extends AbstractDiagnosticsTestSpec { } } + @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/objects") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Objects extends AbstractDiagnosticsTestSpec { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInObjects() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/objects"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + + @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Inheritance extends AbstractDiagnosticsTestSpec { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInInheritance() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + + @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Neg extends AbstractDiagnosticsTestSpec { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + @TestMetadata("1.kt") + public void test1() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/1.kt"); + } + + @TestMetadata("2.kt") + public void test2() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/2.kt"); + } + + @TestMetadata("3.kt") + public void test3() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/3.kt"); + } + + @TestMetadata("4.kt") + public void test4() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/4.kt"); + } + + @TestMetadata("5.kt") + public void test5() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/5.kt"); + } + + @TestMetadata("6.kt") + public void test6() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/6.kt"); + } + + @TestMetadata("7.kt") + public void test7() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/7.kt"); + } + + public void testAllFilesPresentInNeg() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + } + } + } + @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/overload-resolution") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/codegen/BlackBoxCodegenTestSpecGenerated.java b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/codegen/BlackBoxCodegenTestSpecGenerated.java index efe02731b1c..a17d79ff06b 100644 --- a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/codegen/BlackBoxCodegenTestSpecGenerated.java +++ b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/codegen/BlackBoxCodegenTestSpecGenerated.java @@ -4429,41 +4429,6 @@ public class BlackBoxCodegenTestSpecGenerated extends AbstractBlackBoxCodegenTes runTest("compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/12.kt"); } - @TestMetadata("13.kt") - public void test13() throws Exception { - runTest("compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/13.kt"); - } - - @TestMetadata("14.kt") - public void test14() throws Exception { - runTest("compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/14.kt"); - } - - @TestMetadata("15.kt") - public void test15() throws Exception { - runTest("compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/15.kt"); - } - - @TestMetadata("16.kt") - public void test16() throws Exception { - runTest("compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/16.kt"); - } - - @TestMetadata("17.kt") - public void test17() throws Exception { - runTest("compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/17.kt"); - } - - @TestMetadata("18.kt") - public void test18() throws Exception { - runTest("compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/18.kt"); - } - - @TestMetadata("19.kt") - public void test19() throws Exception { - runTest("compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/19.kt"); - } - @TestMetadata("2.kt") public void test2() throws Exception { runTest("compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/2.kt"); diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostic/compiler/based/FirIdeSpecTest.java b/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostic/compiler/based/FirIdeSpecTest.java index a088db66c7e..e2213febd62 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostic/compiler/based/FirIdeSpecTest.java +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostic/compiler/based/FirIdeSpecTest.java @@ -7483,6 +7483,78 @@ public class FirIdeSpecTest extends AbstractDiagnosisCompilerTestDataSpecTest { } } + @Nested + @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/objects") + @TestDataPath("$PROJECT_ROOT") + public class Objects { + @Test + public void testAllFilesPresentInObjects() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/objects"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + + @Nested + @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance") + @TestDataPath("$PROJECT_ROOT") + public class Inheritance { + @Test + public void testAllFilesPresentInInheritance() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + + @Nested + @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg") + @TestDataPath("$PROJECT_ROOT") + public class Neg { + @Test + @TestMetadata("1.kt") + public void test1() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/1.kt"); + } + + @Test + @TestMetadata("2.kt") + public void test2() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/2.kt"); + } + + @Test + @TestMetadata("3.kt") + public void test3() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/3.kt"); + } + + @Test + @TestMetadata("4.kt") + public void test4() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/4.kt"); + } + + @Test + @TestMetadata("5.kt") + public void test5() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/5.kt"); + } + + @Test + @TestMetadata("6.kt") + public void test6() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/6.kt"); + } + + @Test + @TestMetadata("7.kt") + public void test7() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/7.kt"); + } + + @Test + public void testAllFilesPresentInNeg() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + } + } + } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/overload-resolution") @TestDataPath("$PROJECT_ROOT")