diff --git a/compiler/tests-spec/testData/codegen/box/linked/type-system/introduction/p-5/pos/2.1.kt b/compiler/tests-spec/testData/codegen/box/linked/type-system/introduction-1/p-5/pos/2.1.kt similarity index 89% rename from compiler/tests-spec/testData/codegen/box/linked/type-system/introduction/p-5/pos/2.1.kt rename to compiler/tests-spec/testData/codegen/box/linked/type-system/introduction-1/p-5/pos/2.1.kt index fcfa97026cf..02bbc6a7037 100644 --- a/compiler/tests-spec/testData/codegen/box/linked/type-system/introduction/p-5/pos/2.1.kt +++ b/compiler/tests-spec/testData/codegen/box/linked/type-system/introduction-1/p-5/pos/2.1.kt @@ -1,9 +1,10 @@ // WITH_RUNTIME + /* * KOTLIN CODEGEN BOX SPEC TEST (POSITIVE) * - * SPEC VERSION: 0.1-draft - * PLACE: type-system, introduction -> paragraph 5 -> sentence 2 + * SPEC VERSION: 0.1-100 + * PLACE: type-system, introduction-1 -> paragraph 5 -> sentence 2 * NUMBER: 1 * DESCRIPTION: The use of Boolean literals as the identifier (with backtick) in the class. * NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY diff --git a/compiler/tests-spec/testData/codegen/box/linked/type-system/introduction-1/testsMap.json b/compiler/tests-spec/testData/codegen/box/linked/type-system/introduction-1/testsMap.json new file mode 100644 index 00000000000..871050243e9 --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/linked/type-system/introduction-1/testsMap.json @@ -0,0 +1,14 @@ +{ + "5": { + "pos": { + "2": [ + { + "specVersion": "0.1-100", + "casesNumber": 0, + "description": "The use of Boolean literals as the identifier (with backtick) in the class.", + "unexpectedBehaviour": true + } + ] + } + } +} \ No newline at end of file diff --git a/compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-5/neg/2.1.kt b/compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-6/neg/2.1.kt similarity index 93% rename from compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-5/neg/2.1.kt rename to compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-6/neg/2.1.kt index d39039150bd..db53caf5d3c 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-5/neg/2.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-6/neg/2.1.kt @@ -5,8 +5,8 @@ /* * KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE) * - * SPEC VERSION: 0.1-draft - * PLACE: type-system, introduction -> paragraph 5 -> sentence 2 + * SPEC VERSION: 0.1-100 + * PLACE: type-system, introduction-1 -> paragraph 6 -> sentence 2 * NUMBER: 1 * DESCRIPTION: The use of Boolean literals as the identifier (with backtick) in the class. */ diff --git a/compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-5/neg/2.2.kt b/compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-6/neg/2.2.kt similarity index 96% rename from compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-5/neg/2.2.kt rename to compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-6/neg/2.2.kt index e15bfa3742a..ea7fcdb8674 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-5/neg/2.2.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-6/neg/2.2.kt @@ -5,8 +5,8 @@ /* * KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE) * - * SPEC VERSION: 0.1-draft - * PLACE: type-system, introduction -> paragraph 5 -> sentence 2 + * SPEC VERSION: 0.1-100 + * PLACE: type-system, introduction-1 -> paragraph 6 -> sentence 2 * NUMBER: 2 * DESCRIPTION: The use of Boolean literals as the identifier (with backtick) in the class. */ diff --git a/compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-5/neg/2.3.kt b/compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-6/neg/2.3.kt similarity index 90% rename from compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-5/neg/2.3.kt rename to compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-6/neg/2.3.kt index d6b24d5c5bd..ae76ba69a17 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-5/neg/2.3.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-6/neg/2.3.kt @@ -5,8 +5,8 @@ /* * KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE) * - * SPEC VERSION: 0.1-draft - * PLACE: type-system, introduction -> paragraph 5 -> sentence 2 + * SPEC VERSION: 0.1-100 + * PLACE: type-system, introduction-1 -> paragraph 6 -> sentence 2 * NUMBER: 3 * DESCRIPTION: The use of Boolean literals as the identifier (with backtick) in the class. */ diff --git a/compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-7/pos/1.1.kt b/compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-8/pos/1.1.kt similarity index 89% rename from compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-7/pos/1.1.kt rename to compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-8/pos/1.1.kt index 37ddc780529..40aa9af89e8 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-7/pos/1.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-8/pos/1.1.kt @@ -5,9 +5,9 @@ /* * KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE) * - * SPEC VERSION: 0.1-draft - * PLACE: type-system, introduction -> paragraph 7 -> sentence 1 - * RELEVANT PLACES: expressions, constant-literals, real-literals -> paragraph 1 -> sentence 1 + * SPEC VERSION: 0.1-100 + * PLACE: type-system, introduction-1 -> paragraph 8 -> sentence 1 + * RELEVANT PLACES: type-system, type-kinds, built-in-types, kotlin.Any -> paragraph 1 -> sentence 1 * NUMBER: 1 * DESCRIPTION: The use of Boolean literals as the identifier (with backtick) in the class. * HELPERS: checkType diff --git a/compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-7/pos/2.1.kt b/compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-8/pos/2.1.kt similarity index 94% rename from compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-7/pos/2.1.kt rename to compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-8/pos/2.1.kt index 0264c59e4a5..8aa18961c2c 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-7/pos/2.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-8/pos/2.1.kt @@ -5,8 +5,8 @@ /* * KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE) * - * SPEC VERSION: 0.1-draft - * PLACE: type-system, introduction -> paragraph 7 -> sentence 2 + * SPEC VERSION: 0.1-100 + * PLACE: type-system, introduction-1 -> paragraph 8 -> sentence 2 * NUMBER: 1 * DESCRIPTION: The use of Boolean literals as the identifier (with backtick) in the class. * HELPERS: checkType diff --git a/compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/testsMap.json b/compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/testsMap.json new file mode 100644 index 00000000000..671f85c967f --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/testsMap.json @@ -0,0 +1,64 @@ +{ + "7": { + "pos": { + "1": [ + { + "specVersion": "0.1-100", + "casesNumber": 11, + "description": "The use of Boolean literals as the identifier (with backtick) in the class.", + "unexpectedBehaviour": false + }, + { + "specVersion": "0.1-100", + "casesNumber": 9, + "description": "The use of Boolean literals as the identifier (with backtick) in the class.", + "unexpectedBehaviour": false + } + ] + } + }, + "6": { + "neg": { + "2": [ + { + "specVersion": "0.1-100", + "casesNumber": 11, + "description": "The use of Boolean literals as the identifier (with backtick) in the class.", + "unexpectedBehaviour": false + }, + { + "specVersion": "0.1-100", + "casesNumber": 5, + "description": "The use of Boolean literals as the identifier (with backtick) in the class.", + "unexpectedBehaviour": false + }, + { + "specVersion": "0.1-100", + "casesNumber": 15, + "description": "The use of Boolean literals as the identifier (with backtick) in the class.", + "unexpectedBehaviour": false + } + ] + } + }, + "8": { + "pos": { + "2": [ + { + "specVersion": "0.1-100", + "casesNumber": 15, + "description": "The use of Boolean literals as the identifier (with backtick) in the class.", + "unexpectedBehaviour": false + } + ], + "1": [ + { + "specVersion": "0.1-100", + "casesNumber": 13, + "description": "The use of Boolean literals as the identifier (with backtick) in the class.", + "unexpectedBehaviour": false + } + ] + } + } +} \ No newline at end of file diff --git a/compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.any/p-1/pos/1.1.kt b/compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.any/p-1/pos/1.1.kt new file mode 100644 index 00000000000..c732b6819db --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.any/p-1/pos/1.1.kt @@ -0,0 +1,111 @@ +// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER +// !LANGUAGE: +NewInference +// SKIP_TXT + +/* + * KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE) + * + * SPEC VERSION: 0.1-100 + * PLACE: type-system, type-kinds, built-in-types, kotlin.any -> paragraph 1 -> sentence 1 + * RELEVANT PLACES: type-system, introduction-1 -> paragraph 7 -> sentence 1 + * NUMBER: 1 + * DESCRIPTION: The use of Boolean literals as the identifier (with backtick) in the class. + * HELPERS: checkType, functions + */ + +// TESTCASE NUMBER: 1 +class Case1 + +fun case_1(x: Case1) { + checkSubtype(x) + val z: Any = Case1() + funWithAnyArg(Case1()) +} + +// TESTCASE NUMBER: 2 +interface Case2 + +fun case_2(x: Case2) { + checkSubtype(x) + fun z(): Any = x + funWithAnyArg(x) +} + +// TESTCASE NUMBER: 3 +data class Case3(val x: Int) +val case_3_1: Any = Case3(11) + +fun case_3(x: Case3) { + checkSubtype(x) + funWithAnyArg(Case3(10)) +} + +// TESTCASE NUMBER: 4 +sealed class Case4 + +fun case_4(x: Case4) { + checkSubtype(x) + funWithAnyArg(x) +} + +// TESTCASE NUMBER: 5 +annotation class Case5 { + class Case5 {} +} + +fun case_5(x: Case5, y: Case5.Case5) { + checkSubtype(x) + checkSubtype(y) + val z1: Any = x + val z2: Any = y + funWithAnyArg(x) + funWithAnyArg(Case5.Case5()) +} + +// TESTCASE NUMBER: 6 +enum class Case6 {TEST; + inner class Case6 {} +} +val case_6_1: Any = Case6.TEST.Case6() + +fun case_6(x: Case6.Case6) { + checkSubtype(x) + funWithAnyArg(case_6_1) +} + +// TESTCASE NUMBER: 7 +enum class Case7 {; + data class Case7(val x: Int) {} +} + +fun case_7(x: Case7.Case7) { + checkSubtype(x) + val z: Any = Case7.Case7(10) + funWithAnyArg(Case7.Case7(10)) +} + +// TESTCASE NUMBER: 8 +enum class Case8 {; + data class Case8(val x: Int) {} +} + +typealias Case8_1 = Case8.Case8 + +fun case_8(x: Case8_1) { + checkSubtype(x) + val z: Any = Case8_1(10) + funWithAnyArg(Case8_1(10)) +} + +// TESTCASE NUMBER: 9 +interface Case9 {; + data class Case9(val x: Int) { + interface Case9 + } +} + +val case_9_1: Any = object : Case9.Case9.Case9 {} +fun case_9(x: Case9.Case9.Case9) { + checkSubtype(x) + funWithAnyArg(object : Case9.Case9.Case9 {}) +} diff --git a/compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.any/p-1/pos/1.2.kt b/compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.any/p-1/pos/1.2.kt new file mode 100644 index 00000000000..ebabc4eddcb --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.any/p-1/pos/1.2.kt @@ -0,0 +1,107 @@ +// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER +// !LANGUAGE: +NewInference +// SKIP_TXT + +/* + * KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE) + * + * SPEC VERSION: 0.1-100 + * PLACE: type-system, type-kinds, built-in-types, kotlin.any -> paragraph 1 -> sentence 1 + * RELEVANT PLACES: type-system, introduction-1 -> paragraph 7 -> sentence 1 + * NUMBER: 2 + * DESCRIPTION: The use of Boolean literals as the identifier (with backtick) in the class. + * HELPERS: checkType, functions + */ + +// TESTCASE NUMBER: 1 +fun case_1() { + checkSubtype("") + val x: Any = "" + funWithAnyArg("") + checkSubtype(""" + ……… + """) + val y: Any = """0""" + funWithAnyArg(""" + ===== + """.trimIndent()) +} + +// TESTCASE NUMBER: 2 +fun case_2() { + checkSubtype(0) + fun z(): Any = 0 + funWithAnyArg(0) +} + +// TESTCASE NUMBER: 3 +fun case_3() { + checkSubtype(-0f) + fun z(): Any = -.10000e1 + funWithAnyArg(10.1) +} + +// TESTCASE NUMBER: 4 +fun case_4() { + checkSubtype(throw Exception()) + var z1: Any = return@case_4 + while (true) { + funWithAnyArg(break) + } + checkSubtype(null!!) + fun z2(): Any = null!! + funWithAnyArg(null!!) +} + +// TESTCASE NUMBER: 5 +fun case_5() { + checkSubtype('1') + var z: Any = 'a' + funWithAnyArg('…') +} + +// TESTCASE NUMBER: 6 +fun case_6() { + checkSubtype({}) + val z: Any = { x: Any -> println(x) } + funWithAnyArg {} +} + +// TESTCASE NUMBER: 7 +fun case_7() { + checkSubtype(object {}) + val z: Any = { x: Any -> object { val y = x } }(10) + funWithAnyArg(object : Comparable { + override fun compareTo(other: Any) = TODO() + }) +} + +// TESTCASE NUMBER: 8 +fun case_8() { + checkSubtype(object {}::class) + val z: Any = {}::class + funWithAnyArg(0E0::class) +} + +// TESTCASE NUMBER: 9 +fun case_9() { + checkSubtype(object {}::class) + val z: Any = {}::class + funWithAnyArg(0E0::class) +} + +// TESTCASE NUMBER: 10 +fun case_10() { + checkSubtype(0 + 0.0) + val z: Any = if (true) "" else '"' + label@ { + funWithAnyArg(return@label) + } +} + +// TESTCASE NUMBER: 11 +fun case_11() { + checkSubtype(Any()) + val z: Any = if (true) Any() else Any() + funWithAnyArg(Any()) +} diff --git a/compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.any/testsMap.json b/compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.any/testsMap.json new file mode 100644 index 00000000000..7e7e303e52f --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.any/testsMap.json @@ -0,0 +1,14 @@ +{ + "1": { + "pos": { + "1": [ + { + "specVersion": "0.1-100", + "casesNumber": 13, + "description": "The use of Boolean literals as the identifier (with backtick) in the class.", + "unexpectedBehaviour": false + } + ] + } + } +} \ No newline at end of file diff --git a/compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.any/testsMap.txt b/compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.any/testsMap.txt new file mode 100644 index 00000000000..1243e462d27 --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.any/testsMap.txt @@ -0,0 +1,12 @@ +/* + * This file is generated by {@link org.jetbrains.kotlin.spec.tasks.generateTests}. DO NOT MODIFY MANUALLY. + * This file is used in the HTML version of the Kotlin Specification (https://kotlin.github.io/kotlin-spec) to show tests coverage for sentences. + * + * Content format: + * + * {paragraphNumber} + * {testType: neg|pos}: {sentenceNumber}-{numberOfTests|testPathToAnotherSection}, ... + */ + +1 + pos: 1-2, 1-type-system/introduction-1/7/pos/1.1.kt