[Spec tests] Add tests for subtyping rules for simple classifier type

This commit is contained in:
anastasiia.spaseeva
2020-07-28 11:14:34 +03:00
parent 1801344c76
commit 4ad3847224
7 changed files with 426 additions and 6 deletions
@@ -0,0 +1,118 @@
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNREACHABLE_CODE -UNUSED_PARAMETER
// SKIP_TXT
// TESTCASE NUMBER: 1
class A
fun foo() : A = A()
interface AI{
val ai0: String
get() = ""
}
val AI.ai1: Int
get() = 1
fun case1(a: A, ai: AI , nothing: Nothing) {
checkSubtype<Any>(a)
checkSubtype<A>(nothing)
checkSubtype<Any>(foo())
checkSubtype<A>(nothing)
checkSubtype<Any>(ai)
checkSubtype<AI>(nothing)
checkSubtype<Any>(ai.ai0)
checkSubtype<String>(nothing)
checkSubtype<Any>(ai.ai1)
checkSubtype<Int>(nothing)
checkSubtype<Any>(nothing)
checkSubtype<Nothing>(nothing)
}
// TESTCASE NUMBER: 2
fun case2( nothing: Nothing) {
checkSubtype<Any>("a")
checkSubtype<String>(nothing)
checkSubtype<CharSequence>(nothing)
checkSubtype<CharSequence>("")
checkSubtype<Any>(1)
checkSubtype<Int>(nothing)
checkSubtype<Any>(1.0)
checkSubtype<Double>(nothing)
checkSubtype<Any>(true)
checkSubtype<Boolean>(nothing)
checkSubtype<Any>(Unit)
checkSubtype<Unit>(nothing)
checkSubtype<Any>(Exception())
checkSubtype<Exception>(nothing)
}
// TESTCASE NUMBER: 3
class A3(val x : Int){
class Nested{
fun case3(nothing: Nothing) {
checkSubtype<Any>(this)
checkSubtype<A3.Nested>(this)
checkSubtype<A3.Nested>(nothing)
}
}
inner class AInner() {
fun foo() = x
fun case3(nothing: Nothing) {
checkSubtype<Any>(this)
checkSubtype<A3.AInner>(this)
checkSubtype<A3.AInner>(nothing)
}
}
companion object{
private fun case3(nothing: Nothing) {
checkSubtype<Any>(this)
checkSubtype<A3.Companion>(this)
checkSubtype<A3.Companion>(nothing)
}
}
}
// TESTCASE NUMBER: 4
class A4(val x: Int) {
interface AN
inner class AInner() {
fun foo() = x
}
companion object {}
}
fun case4(a: A4, an: A4.AN, nothing: Nothing) {
checkSubtype<Any>(A4.Companion)
checkSubtype<A4.Companion>(nothing)
checkSubtype<Any>(a.AInner())
checkSubtype<A4.AInner>(nothing)
checkSubtype<Any>(an)
checkSubtype<A4.AN>(nothing)
}
@@ -0,0 +1,130 @@
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNREACHABLE_CODE -UNUSED_PARAMETER
// SKIP_TXT
/*
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-464
* MAIN LINK: type-system, subtyping, subtyping-rules -> paragraph 2 -> sentence 1
* SECONDARY LINKS: type-system, subtyping -> paragraph 2 -> sentence 1
* type-system, subtyping -> paragraph 2 -> sentence 2
* PRIMARY LINKS: type-system, subtyping, subtyping-rules -> paragraph 2 -> sentence 2
* NUMBER: 1
* DESCRIPTION: type T is subtype of Any and Noting is subtype of T
* HELPERS: checkType
*/
// TESTCASE NUMBER: 1
class A
fun foo() : A = A()
interface AI{
val ai0: String
get() = ""
}
val AI.ai1: Int
get() = 1
fun case1(a: A, ai: AI , nothing: Nothing) {
checkSubtype<Any>(a)
checkSubtype<A>(nothing)
checkSubtype<Any>(foo())
checkSubtype<A>(nothing)
checkSubtype<Any>(ai)
checkSubtype<AI>(nothing)
checkSubtype<Any>(ai.ai0)
checkSubtype<String>(nothing)
checkSubtype<Any>(ai.ai1)
checkSubtype<Int>(nothing)
checkSubtype<Any>(nothing)
checkSubtype<Nothing>(nothing)
}
// TESTCASE NUMBER: 2
fun case2( nothing: Nothing) {
checkSubtype<Any>("a")
checkSubtype<String>(nothing)
checkSubtype<CharSequence>(nothing)
checkSubtype<CharSequence>("")
checkSubtype<Any>(1)
checkSubtype<Int>(nothing)
checkSubtype<Any>(1.0)
checkSubtype<Double>(nothing)
checkSubtype<Any>(true)
checkSubtype<Boolean>(nothing)
checkSubtype<Any>(Unit)
checkSubtype<Unit>(nothing)
checkSubtype<Any>(Exception())
checkSubtype<Exception>(nothing)
}
// TESTCASE NUMBER: 3
class A3(val x : Int){
class Nested{
fun case3(nothing: Nothing) {
checkSubtype<Any>(this)
checkSubtype<A3.Nested>(this)
checkSubtype<A3.Nested>(nothing)
}
}
inner class AInner() {
fun foo() = x
fun case3(nothing: Nothing) {
checkSubtype<Any>(this)
checkSubtype<A3.AInner>(this)
checkSubtype<A3.AInner>(nothing)
}
}
companion object{
private fun case3(nothing: Nothing) {
checkSubtype<Any>(this)
checkSubtype<A3.Companion>(this)
checkSubtype<A3.Companion>(nothing)
}
}
}
// TESTCASE NUMBER: 4
class A4(val x: Int) {
interface AN
inner class AInner() {
fun foo() = x
}
companion object {}
}
fun case4(a: A4, an: A4.AN, nothing: Nothing) {
checkSubtype<Any>(A4.Companion)
checkSubtype<A4.Companion>(nothing)
checkSubtype<Any>(a.AInner())
checkSubtype<A4.AInner>(nothing)
checkSubtype<Any>(an)
checkSubtype<A4.AN>(nothing)
}
@@ -10,6 +10,35 @@
"unexpectedBehaviour": false,
"linkType": "primary",
"helpers": "checkType, functions"
},
{
"specVersion": "0.1-213",
"casesNumber": 2,
"description": "Check of Nothing type is a subtype of any types",
"path": "compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.nothing/p-1/pos/1.1.kt",
"unexpectedBehaviour": false,
"linkType": "secondary",
"helpers": "checkType, functions"
},
{
"specVersion": "0.1-464",
"casesNumber": 4,
"description": "type T is subtype of Any and Noting is subtype of T",
"path": "compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-rules/p-2/pos/1.1.kt",
"unexpectedBehaviour": false,
"linkType": "main",
"helpers": "checkType"
}
],
"2": [
{
"specVersion": "0.1-464",
"casesNumber": 4,
"description": "type T is subtype of Any and Noting is subtype of T",
"path": "compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-rules/p-2/pos/1.1.kt",
"unexpectedBehaviour": false,
"linkType": "primary",
"helpers": "checkType"
}
],
"3": [
@@ -0,0 +1,28 @@
{
"2": {
"pos": {
"1": [
{
"specVersion": "0.1-464",
"casesNumber": 4,
"description": "type T is subtype of Any and Noting is subtype of T",
"path": "compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-rules/p-2/pos/1.1.kt",
"unexpectedBehaviour": false,
"linkType": "secondary",
"helpers": "checkType"
}
],
"2": [
{
"specVersion": "0.1-464",
"casesNumber": 4,
"description": "type T is subtype of Any and Noting is subtype of T",
"path": "compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-rules/p-2/pos/1.1.kt",
"unexpectedBehaviour": false,
"linkType": "secondary",
"helpers": "checkType"
}
]
}
}
}
@@ -9,6 +9,7 @@
*
* SPEC VERSION: 0.1-213
* MAIN LINK: type-system, type-kinds, built-in-types, kotlin.nothing -> paragraph 1 -> sentence 1
* SECONDARY LINKS: type-system, subtyping, subtyping-rules -> paragraph 2 -> sentence 1
* NUMBER: 1
* DESCRIPTION: Check of Nothing type is a subtype of any types
* HELPERS: checkType, functions
@@ -25,7 +25,7 @@ public class DiagnosticsTestSpecGenerated extends AbstractDiagnosticsTestSpec {
}
public void testAllFilesPresentInDiagnostics() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "helpers", "linked/annotations", "linked/built-in-types-and-their-semantics", "linked/control--and-data-flow-analysis.control-flow-graph.expressions-1.conditional-expressions", "linked/control--and-data-flow-analysis/performing-analysis-on-the-control-flow-graph", "linked/declarations/classifier-declaration/classifier-initialization", "linked/declarations/function-declaration", "linked/declarations/property-declaration/property-initialization", "linked/expressions/call-and-property-access-expressions", "linked/expressions/function-literals", "linked/inheritance", "linked/overload-resolution/c-level-partition", "linked/overload-resolution/determining-function-applicability-for-a-specific-call/rationale", "linked/overloadable-operators", "linked/statements/assignments/simple-assignments", "linked/type-inference/local-type-inference", "linked/type-inference/smart-casts/smart-cast-types", "linked/type-system/subtyping", "linked/type-system/type-kinds/type-parameters");
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "helpers", "linked/annotations", "linked/built-in-types-and-their-semantics", "linked/control--and-data-flow-analysis.control-flow-graph.expressions-1.conditional-expressions", "linked/control--and-data-flow-analysis/performing-analysis-on-the-control-flow-graph", "linked/declarations/classifier-declaration/classifier-initialization", "linked/declarations/function-declaration", "linked/declarations/property-declaration/property-initialization", "linked/expressions/call-and-property-access-expressions", "linked/expressions/function-literals", "linked/inheritance", "linked/overload-resolution/c-level-partition", "linked/overload-resolution/determining-function-applicability-for-a-specific-call/rationale", "linked/overloadable-operators", "linked/statements/assignments/simple-assignments", "linked/type-inference/local-type-inference", "linked/type-inference/smart-casts/smart-cast-types", "linked/type-system/subtyping/subtyping-for-nullable-types", "linked/type-system/type-kinds/type-parameters");
}
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked")
@@ -37,7 +37,7 @@ public class DiagnosticsTestSpecGenerated extends AbstractDiagnosticsTestSpec {
}
public void testAllFilesPresentInLinked() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "annotations", "built-in-types-and-their-semantics", "control--and-data-flow-analysis.control-flow-graph.expressions-1.conditional-expressions", "control--and-data-flow-analysis/performing-analysis-on-the-control-flow-graph", "declarations/classifier-declaration/classifier-initialization", "declarations/function-declaration", "declarations/property-declaration/property-initialization", "expressions/call-and-property-access-expressions", "expressions/function-literals", "inheritance", "overload-resolution/c-level-partition", "overload-resolution/determining-function-applicability-for-a-specific-call/rationale", "overloadable-operators", "statements/assignments/simple-assignments", "type-inference/local-type-inference", "type-inference/smart-casts/smart-cast-types", "type-system/subtyping", "type-system/type-kinds/type-parameters");
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "annotations", "built-in-types-and-their-semantics", "control--and-data-flow-analysis.control-flow-graph.expressions-1.conditional-expressions", "control--and-data-flow-analysis/performing-analysis-on-the-control-flow-graph", "declarations/classifier-declaration/classifier-initialization", "declarations/function-declaration", "declarations/property-declaration/property-initialization", "expressions/call-and-property-access-expressions", "expressions/function-literals", "inheritance", "overload-resolution/c-level-partition", "overload-resolution/determining-function-applicability-for-a-specific-call/rationale", "overloadable-operators", "statements/assignments/simple-assignments", "type-inference/local-type-inference", "type-inference/smart-casts/smart-cast-types", "type-system/subtyping/subtyping-for-nullable-types", "type-system/type-kinds/type-parameters");
}
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis")
@@ -5591,7 +5591,7 @@ public class DiagnosticsTestSpecGenerated extends AbstractDiagnosticsTestSpec {
}
public void testAllFilesPresentInType_system() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "subtyping", "type-kinds/type-parameters");
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "subtyping/subtyping-for-nullable-types", "type-kinds/type-parameters");
}
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1")
@@ -5684,6 +5684,63 @@ public class DiagnosticsTestSpecGenerated extends AbstractDiagnosticsTestSpec {
}
}
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Subtyping extends AbstractDiagnosticsTestSpec {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInSubtyping() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "subtyping-for-nullable-types");
}
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-rules")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Subtyping_rules extends AbstractDiagnosticsTestSpec {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInSubtyping_rules() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-rules"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-rules/p-2")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class P_2 extends AbstractDiagnosticsTestSpec {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInP_2() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-rules/p-2"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-rules/p-2/pos")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Pos extends AbstractDiagnosticsTestSpec {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
@TestMetadata("1.1.kt")
public void test1_1() throws Exception {
runTest("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-rules/p-2/pos/1.1.kt");
}
public void testAllFilesPresentInPos() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-rules/p-2/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
}
}
}
}
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/type-contexts-and-scopes")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -25,7 +25,7 @@ public class FirDiagnosticsTestSpecGenerated extends AbstractFirDiagnosticsTestS
}
public void testAllFilesPresentInDiagnostics() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "helpers", "linked/annotations", "linked/built-in-types-and-their-semantics", "linked/control--and-data-flow-analysis.control-flow-graph.expressions-1.conditional-expressions", "linked/control--and-data-flow-analysis/performing-analysis-on-the-control-flow-graph", "linked/declarations/classifier-declaration/classifier-initialization", "linked/declarations/function-declaration", "linked/declarations/property-declaration/property-initialization", "linked/expressions/call-and-property-access-expressions", "linked/expressions/function-literals", "linked/inheritance", "linked/overload-resolution/c-level-partition", "linked/overload-resolution/determining-function-applicability-for-a-specific-call/rationale", "linked/overloadable-operators", "linked/statements/assignments/simple-assignments", "linked/type-inference/local-type-inference", "linked/type-inference/smart-casts/smart-cast-types", "linked/type-system/subtyping", "linked/type-system/type-kinds/type-parameters");
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "helpers", "linked/annotations", "linked/built-in-types-and-their-semantics", "linked/control--and-data-flow-analysis.control-flow-graph.expressions-1.conditional-expressions", "linked/control--and-data-flow-analysis/performing-analysis-on-the-control-flow-graph", "linked/declarations/classifier-declaration/classifier-initialization", "linked/declarations/function-declaration", "linked/declarations/property-declaration/property-initialization", "linked/expressions/call-and-property-access-expressions", "linked/expressions/function-literals", "linked/inheritance", "linked/overload-resolution/c-level-partition", "linked/overload-resolution/determining-function-applicability-for-a-specific-call/rationale", "linked/overloadable-operators", "linked/statements/assignments/simple-assignments", "linked/type-inference/local-type-inference", "linked/type-inference/smart-casts/smart-cast-types", "linked/type-system/subtyping/subtyping-for-nullable-types", "linked/type-system/type-kinds/type-parameters");
}
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked")
@@ -37,7 +37,7 @@ public class FirDiagnosticsTestSpecGenerated extends AbstractFirDiagnosticsTestS
}
public void testAllFilesPresentInLinked() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "annotations", "built-in-types-and-their-semantics", "control--and-data-flow-analysis.control-flow-graph.expressions-1.conditional-expressions", "control--and-data-flow-analysis/performing-analysis-on-the-control-flow-graph", "declarations/classifier-declaration/classifier-initialization", "declarations/function-declaration", "declarations/property-declaration/property-initialization", "expressions/call-and-property-access-expressions", "expressions/function-literals", "inheritance", "overload-resolution/c-level-partition", "overload-resolution/determining-function-applicability-for-a-specific-call/rationale", "overloadable-operators", "statements/assignments/simple-assignments", "type-inference/local-type-inference", "type-inference/smart-casts/smart-cast-types", "type-system/subtyping", "type-system/type-kinds/type-parameters");
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "annotations", "built-in-types-and-their-semantics", "control--and-data-flow-analysis.control-flow-graph.expressions-1.conditional-expressions", "control--and-data-flow-analysis/performing-analysis-on-the-control-flow-graph", "declarations/classifier-declaration/classifier-initialization", "declarations/function-declaration", "declarations/property-declaration/property-initialization", "expressions/call-and-property-access-expressions", "expressions/function-literals", "inheritance", "overload-resolution/c-level-partition", "overload-resolution/determining-function-applicability-for-a-specific-call/rationale", "overloadable-operators", "statements/assignments/simple-assignments", "type-inference/local-type-inference", "type-inference/smart-casts/smart-cast-types", "type-system/subtyping/subtyping-for-nullable-types", "type-system/type-kinds/type-parameters");
}
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis")
@@ -5591,7 +5591,7 @@ public class FirDiagnosticsTestSpecGenerated extends AbstractFirDiagnosticsTestS
}
public void testAllFilesPresentInType_system() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "subtyping", "type-kinds/type-parameters");
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "subtyping/subtyping-for-nullable-types", "type-kinds/type-parameters");
}
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1")
@@ -5684,6 +5684,63 @@ public class FirDiagnosticsTestSpecGenerated extends AbstractFirDiagnosticsTestS
}
}
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Subtyping extends AbstractFirDiagnosticsTestSpec {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInSubtyping() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "subtyping-for-nullable-types");
}
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-rules")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Subtyping_rules extends AbstractFirDiagnosticsTestSpec {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInSubtyping_rules() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-rules"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-rules/p-2")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class P_2 extends AbstractFirDiagnosticsTestSpec {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInP_2() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-rules/p-2"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-rules/p-2/pos")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Pos extends AbstractFirDiagnosticsTestSpec {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
@TestMetadata("1.1.kt")
public void test1_1() throws Exception {
runTest("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-rules/p-2/pos/1.1.kt");
}
public void testAllFilesPresentInPos() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-rules/p-2/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
}
}
}
}
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/type-contexts-and-scopes")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)