[Spec tests] Update spec version
This commit is contained in:
+2
@@ -1,6 +1,8 @@
|
||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION
|
||||
// SKIP_TXT
|
||||
|
||||
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
fun case_1(value_1: Boolean?): String = when(value_1) {
|
||||
true -> ""
|
||||
+2
-2
@@ -4,8 +4,8 @@
|
||||
/*
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-100
|
||||
* MAIN LINK: expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 10
|
||||
* SPEC VERSION: 0.1-435
|
||||
* MAIN LINK: expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 11
|
||||
* NUMBER: 1
|
||||
* DESCRIPTION: Non-exhaustive when using nullable boolean values.
|
||||
*/
|
||||
+1
@@ -1,6 +1,7 @@
|
||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION
|
||||
// SKIP_TXT
|
||||
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
fun case_1(value_1: SealedClass?): String = when(value_1) {
|
||||
is SealedChild1 -> ""
|
||||
+2
-2
@@ -4,8 +4,8 @@
|
||||
/*
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-100
|
||||
* MAIN LINK: expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 10
|
||||
* SPEC VERSION: 0.1-435
|
||||
* MAIN LINK: expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 11
|
||||
* NUMBER: 2
|
||||
* DESCRIPTION: Non-exhaustive when using subclasses of the nullable sealed class.
|
||||
* HELPERS: sealedClasses
|
||||
+1
@@ -1,6 +1,7 @@
|
||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION
|
||||
// SKIP_TXT
|
||||
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
fun case_1(value_1: EnumClass?): String = when(value_1) {
|
||||
EnumClass.EAST -> ""
|
||||
+2
-2
@@ -4,8 +4,8 @@
|
||||
/*
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-100
|
||||
* MAIN LINK: expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 10
|
||||
* SPEC VERSION: 0.1-435
|
||||
* MAIN LINK: expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 11
|
||||
* NUMBER: 3
|
||||
* DESCRIPTION: Non-exhaustive when using nullable enum values.
|
||||
* HELPERS: enumClasses
|
||||
+1
@@ -1,6 +1,7 @@
|
||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION
|
||||
// SKIP_TXT
|
||||
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
fun case_1(value_1: SealedClass): String = when(value_1) {
|
||||
is SealedChild1 -> ""
|
||||
+2
-2
@@ -4,8 +4,8 @@
|
||||
/*
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-100
|
||||
* MAIN LINK: expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 6
|
||||
* SPEC VERSION: 0.1-435
|
||||
* MAIN LINK: expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
|
||||
* NUMBER: 1
|
||||
* DESCRIPTION: Non-exhaustive when using subclasses of the sealed class.
|
||||
* HELPERS: sealedClasses
|
||||
+10
-10
@@ -4,22 +4,22 @@
|
||||
/*
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-100
|
||||
* SPEC VERSION: 0.1-435
|
||||
* MAIN LINK: expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 10
|
||||
* NUMBER: 1
|
||||
* DESCRIPTION: Exhaustive when using nullable boolean values.
|
||||
* DESCRIPTION: Exhaustive when using enum values.
|
||||
* HELPERS: enumClasses
|
||||
*/
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
fun case_1(value_1: Boolean?): String = when (value_1) {
|
||||
true -> ""
|
||||
false -> ""
|
||||
null -> ""
|
||||
fun case_1(dir: EnumClass): String = when (dir) {
|
||||
EnumClass.EAST -> ""
|
||||
EnumClass.NORTH -> ""
|
||||
EnumClass.SOUTH -> ""
|
||||
EnumClass.WEST -> ""
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
fun case_2(value_1: Boolean?): String = when (value_1) {
|
||||
true && false && ((true || false)) || true && !!!false && !!!true -> ""
|
||||
true && false && ((true || false)) || true && !!!false -> ""
|
||||
null -> ""
|
||||
fun case_2(value_1: EnumClassSingle): String = when (value_1) {
|
||||
EnumClassSingle.EVERYTHING -> ""
|
||||
}
|
||||
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
// FIR_IDENTICAL
|
||||
// SKIP_TXT
|
||||
|
||||
/*
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-435
|
||||
* MAIN LINK: expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 11
|
||||
* NUMBER: 1
|
||||
* DESCRIPTION: Exhaustive when using nullable boolean values.
|
||||
*/
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
fun case_1(value_1: Boolean?): String = when (value_1) {
|
||||
true -> ""
|
||||
false -> ""
|
||||
null -> ""
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
fun case_2(value_1: Boolean?): String = when (value_1) {
|
||||
true && false && ((true || false)) || true && !!!false && !!!true -> ""
|
||||
true && false && ((true || false)) || true && !!!false -> ""
|
||||
null -> ""
|
||||
}
|
||||
+1
@@ -1,5 +1,6 @@
|
||||
// SKIP_TXT
|
||||
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
fun case_1(value_1: EnumClass?): String = when (value_1) {
|
||||
EnumClass.EAST -> ""
|
||||
+2
-2
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-100
|
||||
* MAIN LINK: expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 10
|
||||
* SPEC VERSION: 0.1-435
|
||||
* MAIN LINK: expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 11
|
||||
* NUMBER: 2
|
||||
* DESCRIPTION: Exhaustive when using nullable enum values.
|
||||
* HELPERS: enumClasses
|
||||
+1
@@ -1,5 +1,6 @@
|
||||
// SKIP_TXT
|
||||
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
fun case_1(value_1: SealedClass?): Int = when (value_1) {
|
||||
is SealedChild1 -> value_1.number
|
||||
+2
-2
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-100
|
||||
* MAIN LINK: expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 10
|
||||
* SPEC VERSION: 0.1-435
|
||||
* MAIN LINK: expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 11
|
||||
* NUMBER: 3
|
||||
* DESCRIPTION: Exhaustive when using subclasses of the nullable sealed class.
|
||||
* HELPERS: sealedClasses
|
||||
+1
@@ -1,6 +1,7 @@
|
||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION
|
||||
// SKIP_TXT
|
||||
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
fun case_1(value_1: SealedClass): Int = when (value_1) {
|
||||
is SealedChild1 -> value_1.number
|
||||
+2
-2
@@ -4,8 +4,8 @@
|
||||
/*
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-100
|
||||
* MAIN LINK: expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 6
|
||||
* SPEC VERSION: 0.1-435
|
||||
* MAIN LINK: expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 7
|
||||
* NUMBER: 1
|
||||
* DESCRIPTION: Exhaustive when using subclasses of the sealed class.
|
||||
* HELPERS: sealedClasses
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
// FIR_IDENTICAL
|
||||
// SKIP_TXT
|
||||
|
||||
/*
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-100
|
||||
* MAIN LINK: expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 8
|
||||
* NUMBER: 1
|
||||
* DESCRIPTION: Exhaustive when using enum values.
|
||||
* HELPERS: enumClasses
|
||||
*/
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
fun case_1(dir: EnumClass): String = when (dir) {
|
||||
EnumClass.EAST -> ""
|
||||
EnumClass.NORTH -> ""
|
||||
EnumClass.SOUTH -> ""
|
||||
EnumClass.WEST -> ""
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
fun case_2(value_1: EnumClassSingle): String = when (value_1) {
|
||||
EnumClassSingle.EVERYTHING -> ""
|
||||
}
|
||||
+163
-161
@@ -1,64 +1,32 @@
|
||||
{
|
||||
"2": {
|
||||
"neg": {
|
||||
"10": [
|
||||
"11": [
|
||||
{
|
||||
"specVersion": "0.1-100",
|
||||
"casesNumber": 6,
|
||||
"description": "Non-exhaustive when using nullable enum values.",
|
||||
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/neg/10.3.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "main",
|
||||
"helpers": "enumClasses"
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-100",
|
||||
"specVersion": "0.1-435",
|
||||
"casesNumber": 10,
|
||||
"description": "Non-exhaustive when using subclasses of the nullable sealed class.",
|
||||
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/neg/10.2.kt",
|
||||
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/neg/11.2.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "main",
|
||||
"helpers": "sealedClasses"
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-100",
|
||||
"specVersion": "0.1-435",
|
||||
"casesNumber": 6,
|
||||
"description": "Non-exhaustive when using nullable enum values.",
|
||||
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/neg/11.3.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "main",
|
||||
"helpers": "enumClasses"
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-435",
|
||||
"casesNumber": 3,
|
||||
"description": "Non-exhaustive when using nullable boolean values.",
|
||||
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/neg/10.1.kt",
|
||||
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/neg/11.1.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "main"
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-313",
|
||||
"casesNumber": 0,
|
||||
"description": "Exhaustive boolean nullable",
|
||||
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanNullable.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "primary"
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-152",
|
||||
"casesNumber": 0,
|
||||
"description": "Non exhaustive warning null",
|
||||
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningNull.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "primary"
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-313",
|
||||
"casesNumber": 0,
|
||||
"description": "Else on nullable enum",
|
||||
"path": "compiler/testData/diagnostics/tests/when/ElseOnNullableEnum.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "primary"
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-313",
|
||||
"casesNumber": 0,
|
||||
"description": "Else on nullable enum with smart cast",
|
||||
"path": "compiler/testData/diagnostics/tests/when/ElseOnNullableEnumWithSmartCast.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "primary"
|
||||
}
|
||||
],
|
||||
"1": [
|
||||
@@ -185,76 +153,16 @@
|
||||
"linkType": "primary"
|
||||
}
|
||||
],
|
||||
"6": [
|
||||
"9": [
|
||||
{
|
||||
"specVersion": "0.1-100",
|
||||
"specVersion": "0.1-435",
|
||||
"casesNumber": 12,
|
||||
"description": "Non-exhaustive when using subclasses of the sealed class.",
|
||||
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/neg/6.1.kt",
|
||||
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/neg/9.1.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "main",
|
||||
"helpers": "sealedClasses"
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-152",
|
||||
"casesNumber": 0,
|
||||
"description": "Non exhaustive warning for sealed class",
|
||||
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningForSealedClass.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "primary"
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-152",
|
||||
"casesNumber": 0,
|
||||
"description": "Redundant else",
|
||||
"path": "compiler/testData/diagnostics/tests/when/RedundantElse.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "primary"
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-152",
|
||||
"casesNumber": 0,
|
||||
"description": "Top level sealed",
|
||||
"path": "compiler/testData/diagnostics/tests/when/TopLevelSealed.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "primary"
|
||||
}
|
||||
],
|
||||
"4": [
|
||||
{
|
||||
"specVersion": "0.1-313",
|
||||
"casesNumber": 0,
|
||||
"description": "Exhaustive boolean nullable",
|
||||
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanNullable.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "primary"
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-313",
|
||||
"casesNumber": 0,
|
||||
"description": "Exhaustive boolean brackets",
|
||||
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanBrackets.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "primary"
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-313",
|
||||
"casesNumber": 0,
|
||||
"description": "Exhaustive boolean complex",
|
||||
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanComplex.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "primary"
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-313",
|
||||
"casesNumber": 0,
|
||||
"description": "Exhaustive boolean",
|
||||
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBoolean.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "primary"
|
||||
}
|
||||
],
|
||||
"9": [
|
||||
{
|
||||
"specVersion": "0.1-152",
|
||||
"casesNumber": 0,
|
||||
@@ -360,6 +268,74 @@
|
||||
"linkType": "primary"
|
||||
}
|
||||
],
|
||||
"4": [
|
||||
{
|
||||
"specVersion": "0.1-313",
|
||||
"casesNumber": 0,
|
||||
"description": "Exhaustive boolean nullable",
|
||||
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanNullable.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "primary"
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-313",
|
||||
"casesNumber": 0,
|
||||
"description": "Exhaustive boolean brackets",
|
||||
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanBrackets.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "primary"
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-313",
|
||||
"casesNumber": 0,
|
||||
"description": "Exhaustive boolean complex",
|
||||
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanComplex.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "primary"
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-313",
|
||||
"casesNumber": 0,
|
||||
"description": "Exhaustive boolean",
|
||||
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBoolean.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "primary"
|
||||
}
|
||||
],
|
||||
"10": [
|
||||
{
|
||||
"specVersion": "0.1-313",
|
||||
"casesNumber": 0,
|
||||
"description": "Exhaustive boolean nullable",
|
||||
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanNullable.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "primary"
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-152",
|
||||
"casesNumber": 0,
|
||||
"description": "Non exhaustive warning null",
|
||||
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningNull.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "primary"
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-313",
|
||||
"casesNumber": 0,
|
||||
"description": "Else on nullable enum",
|
||||
"path": "compiler/testData/diagnostics/tests/when/ElseOnNullableEnum.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "primary"
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-313",
|
||||
"casesNumber": 0,
|
||||
"description": "Else on nullable enum with smart cast",
|
||||
"path": "compiler/testData/diagnostics/tests/when/ElseOnNullableEnumWithSmartCast.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "primary"
|
||||
}
|
||||
],
|
||||
"5": [
|
||||
{
|
||||
"specVersion": "0.1-313",
|
||||
@@ -386,6 +362,32 @@
|
||||
"linkType": "primary"
|
||||
}
|
||||
],
|
||||
"6": [
|
||||
{
|
||||
"specVersion": "0.1-152",
|
||||
"casesNumber": 0,
|
||||
"description": "Non exhaustive warning for sealed class",
|
||||
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningForSealedClass.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "primary"
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-152",
|
||||
"casesNumber": 0,
|
||||
"description": "Redundant else",
|
||||
"path": "compiler/testData/diagnostics/tests/when/RedundantElse.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "primary"
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-152",
|
||||
"casesNumber": 0,
|
||||
"description": "Top level sealed",
|
||||
"path": "compiler/testData/diagnostics/tests/when/TopLevelSealed.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "primary"
|
||||
}
|
||||
],
|
||||
"7": [
|
||||
{
|
||||
"specVersion": "0.1-152",
|
||||
@@ -416,56 +418,32 @@
|
||||
]
|
||||
},
|
||||
"pos": {
|
||||
"10": [
|
||||
"11": [
|
||||
{
|
||||
"specVersion": "0.1-100",
|
||||
"casesNumber": 7,
|
||||
"description": "Exhaustive when using subclasses of the nullable sealed class.",
|
||||
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/pos/10.3.kt",
|
||||
"unexpectedBehaviour": true,
|
||||
"linkType": "main",
|
||||
"helpers": "sealedClasses"
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-100",
|
||||
"specVersion": "0.1-435",
|
||||
"casesNumber": 3,
|
||||
"description": "Exhaustive when using nullable enum values.",
|
||||
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/pos/10.2.kt",
|
||||
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/pos/11.2.kt",
|
||||
"unexpectedBehaviour": true,
|
||||
"linkType": "main",
|
||||
"helpers": "enumClasses"
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-100",
|
||||
"specVersion": "0.1-435",
|
||||
"casesNumber": 7,
|
||||
"description": "Exhaustive when using subclasses of the nullable sealed class.",
|
||||
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/pos/11.3.kt",
|
||||
"unexpectedBehaviour": true,
|
||||
"linkType": "main",
|
||||
"helpers": "sealedClasses"
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-435",
|
||||
"casesNumber": 2,
|
||||
"description": "Exhaustive when using nullable boolean values.",
|
||||
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/pos/10.1.kt",
|
||||
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/pos/11.1.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "main"
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-313",
|
||||
"casesNumber": 0,
|
||||
"description": "Exhaustive nullable",
|
||||
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveNullable.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "primary"
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-152",
|
||||
"casesNumber": 0,
|
||||
"description": "Non exhaustive boolean nullable",
|
||||
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveBooleanNullable.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "primary"
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-313",
|
||||
"casesNumber": 0,
|
||||
"description": "Exhaustive platform enum null",
|
||||
"path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumNull.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "primary"
|
||||
}
|
||||
],
|
||||
"1": [
|
||||
@@ -577,28 +555,52 @@
|
||||
"linkType": "primary"
|
||||
}
|
||||
],
|
||||
"8": [
|
||||
"7": [
|
||||
{
|
||||
"specVersion": "0.1-100",
|
||||
"casesNumber": 2,
|
||||
"description": "Exhaustive when using enum values.",
|
||||
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/pos/8.1.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "main",
|
||||
"helpers": "enumClasses"
|
||||
}
|
||||
],
|
||||
"6": [
|
||||
{
|
||||
"specVersion": "0.1-100",
|
||||
"specVersion": "0.1-435",
|
||||
"casesNumber": 9,
|
||||
"description": "Exhaustive when using subclasses of the sealed class.",
|
||||
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/pos/6.1.kt",
|
||||
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/pos/7.1.kt",
|
||||
"unexpectedBehaviour": true,
|
||||
"linkType": "main",
|
||||
"helpers": "sealedClasses"
|
||||
}
|
||||
],
|
||||
"10": [
|
||||
{
|
||||
"specVersion": "0.1-435",
|
||||
"casesNumber": 2,
|
||||
"description": "Exhaustive when using enum values.",
|
||||
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/pos/10.1.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "main",
|
||||
"helpers": "enumClasses"
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-313",
|
||||
"casesNumber": 0,
|
||||
"description": "Exhaustive nullable",
|
||||
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveNullable.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "primary"
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-152",
|
||||
"casesNumber": 0,
|
||||
"description": "Non exhaustive boolean nullable",
|
||||
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveBooleanNullable.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "primary"
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-313",
|
||||
"casesNumber": 0,
|
||||
"description": "Exhaustive platform enum null",
|
||||
"path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumNull.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "primary"
|
||||
}
|
||||
],
|
||||
"9": [
|
||||
{
|
||||
"specVersion": "0.1-313",
|
||||
|
||||
Vendored
-35
@@ -1,35 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VALUE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE
|
||||
// SKIP_TXT
|
||||
|
||||
/*
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-201
|
||||
* MAIN LINK: expressions, when-expression -> paragraph 6 -> sentence 11
|
||||
* NUMBER: 1
|
||||
* DESCRIPTION: 'When' with bound value and non-expressions in 'when condition'.
|
||||
*/
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
fun case_1(value_1: Int, value_2: List<Int>): String {
|
||||
when (value_1) {
|
||||
<!EXPRESSION_EXPECTED!>while (false) {}<!> -> return ""
|
||||
<!EXPRESSION_EXPECTED!>do {} while (false)<!> -> return ""
|
||||
<!EXPRESSION_EXPECTED!>for (value in value_2) {}<!> -> return ""
|
||||
}
|
||||
|
||||
return ""
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 4
|
||||
fun case_4(value_1: Int): String {
|
||||
var value_2: Int
|
||||
var value_3 = 10
|
||||
|
||||
when (value_1) {
|
||||
<!ASSIGNMENT_IN_EXPRESSION_CONTEXT!>value_2 = 10<!> -> return ""
|
||||
<!ASSIGNMENT_IN_EXPRESSION_CONTEXT!>value_3 %= 10<!> -> return ""
|
||||
}
|
||||
|
||||
return ""
|
||||
}
|
||||
+1
@@ -1,5 +1,6 @@
|
||||
// SKIP_TXT
|
||||
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
fun case_1(value_1: Int): String = when {
|
||||
else -> ""
|
||||
+3
-3
@@ -3,9 +3,9 @@
|
||||
/*
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-201
|
||||
* MAIN LINK: expressions, when-expression -> paragraph 6 -> sentence 12
|
||||
* NUMBER: 1
|
||||
* SPEC VERSION: 0.1-435
|
||||
* MAIN LINK: expressions, when-expression -> paragraph 6 -> sentence 7
|
||||
* NUMBER: 2
|
||||
* DESCRIPTION: 'When' without bound value and with 'else' branch not in the last position.
|
||||
*/
|
||||
|
||||
+1
@@ -1,5 +1,6 @@
|
||||
// SKIP_TXT
|
||||
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
fun case_1(value_1: Any?) {
|
||||
when (value_1) {
|
||||
+2
-2
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-201
|
||||
* MAIN LINK: expressions, when-expression -> paragraph 6 -> sentence 10
|
||||
* SPEC VERSION: 0.1-435
|
||||
* MAIN LINK: expressions, when-expression -> paragraph 6 -> sentence 5
|
||||
* NUMBER: 1
|
||||
* DESCRIPTION: 'When' with enumeration of the different variants of expressions in 'when condition'.
|
||||
* HELPERS: typesProvider, classes, functions
|
||||
+1
@@ -1,5 +1,6 @@
|
||||
// SKIP_TXT
|
||||
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
fun case_1(value_1: Any?) {
|
||||
when (value_1) {
|
||||
+2
-2
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-201
|
||||
* MAIN LINK: expressions, when-expression -> paragraph 6 -> sentence 10
|
||||
* SPEC VERSION: 0.1-435
|
||||
* MAIN LINK: expressions, when-expression -> paragraph 6 -> sentence 5
|
||||
* NUMBER: 2
|
||||
* DESCRIPTION: 'When' with different variants of the arithmetic expressions (additive expression and multiplicative expression) in 'when condition'.
|
||||
* HELPERS: typesProvider, classes, functions
|
||||
+1
@@ -1,5 +1,6 @@
|
||||
// SKIP_TXT
|
||||
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
fun case_1(value_1: Int): String {
|
||||
while (true) {
|
||||
+2
-2
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-201
|
||||
* MAIN LINK: expressions, when-expression -> paragraph 6 -> sentence 11
|
||||
* SPEC VERSION: 0.1-435
|
||||
* MAIN LINK: expressions, when-expression -> paragraph 6 -> sentence 6
|
||||
* NUMBER: 1
|
||||
* DESCRIPTION: 'When' with bound value and not allowed break and continue expression (without labels) in 'when condition'.
|
||||
*/
|
||||
Vendored
-5
@@ -1,5 +0,0 @@
|
||||
package
|
||||
|
||||
public fun case_1(/*0*/ value_1: kotlin.Int?): kotlin.String
|
||||
public fun case_2(/*0*/ value_1: kotlin.Any): kotlin.String
|
||||
public fun case_3(/*0*/ value_1: kotlin.Int): kotlin.String
|
||||
+3
-3
@@ -4,9 +4,9 @@
|
||||
/*
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-201
|
||||
* MAIN LINK: expressions, when-expression -> paragraph 6 -> sentence 12
|
||||
* NUMBER: 1
|
||||
* SPEC VERSION: 0.1-435
|
||||
* MAIN LINK: expressions, when-expression -> paragraph 6 -> sentence 7
|
||||
* NUMBER: 2
|
||||
* DESCRIPTION: 'When' without bound value and with else branch in the last position.
|
||||
*/
|
||||
|
||||
+62
-76
@@ -1,16 +1,6 @@
|
||||
{
|
||||
"6": {
|
||||
"neg": {
|
||||
"12": [
|
||||
{
|
||||
"specVersion": "0.1-201",
|
||||
"casesNumber": 3,
|
||||
"description": "\u0027When\u0027 without bound value and with \u0027else\u0027 branch not in the last position.",
|
||||
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/12.1.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "main"
|
||||
}
|
||||
],
|
||||
"1": [
|
||||
{
|
||||
"specVersion": "0.1-296",
|
||||
@@ -116,6 +106,14 @@
|
||||
}
|
||||
],
|
||||
"7": [
|
||||
{
|
||||
"specVersion": "0.1-435",
|
||||
"casesNumber": 3,
|
||||
"description": "\u0027When\u0027 without bound value and with \u0027else\u0027 branch not in the last position.",
|
||||
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/7.2.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "main"
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-313",
|
||||
"casesNumber": 3,
|
||||
@@ -125,32 +123,6 @@
|
||||
"linkType": "main"
|
||||
}
|
||||
],
|
||||
"11": [
|
||||
{
|
||||
"specVersion": "0.1-201",
|
||||
"casesNumber": 2,
|
||||
"description": "\u0027When\u0027 with bound value and non-expressions in \u0027when condition\u0027.",
|
||||
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/11.1.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "main"
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-152",
|
||||
"casesNumber": 0,
|
||||
"description": "When",
|
||||
"path": "compiler/testData/diagnostics/tests/when/When.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "primary"
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-152",
|
||||
"casesNumber": 0,
|
||||
"description": "Redundant else",
|
||||
"path": "compiler/testData/diagnostics/tests/when/RedundantElse.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "primary"
|
||||
}
|
||||
],
|
||||
"5": [
|
||||
{
|
||||
"specVersion": "0.1-152",
|
||||
@@ -212,19 +184,27 @@
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "primary"
|
||||
}
|
||||
],
|
||||
"11": [
|
||||
{
|
||||
"specVersion": "0.1-152",
|
||||
"casesNumber": 0,
|
||||
"description": "When",
|
||||
"path": "compiler/testData/diagnostics/tests/when/When.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "primary"
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-152",
|
||||
"casesNumber": 0,
|
||||
"description": "Redundant else",
|
||||
"path": "compiler/testData/diagnostics/tests/when/RedundantElse.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "primary"
|
||||
}
|
||||
]
|
||||
},
|
||||
"pos": {
|
||||
"12": [
|
||||
{
|
||||
"specVersion": "0.1-201",
|
||||
"casesNumber": 2,
|
||||
"description": "\u0027When\u0027 without bound value and with else branch in the last position.",
|
||||
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/12.1.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "main"
|
||||
}
|
||||
],
|
||||
"1": [
|
||||
{
|
||||
"specVersion": "0.1-296",
|
||||
@@ -287,26 +267,6 @@
|
||||
"linkType": "primary"
|
||||
}
|
||||
],
|
||||
"10": [
|
||||
{
|
||||
"specVersion": "0.1-201",
|
||||
"casesNumber": 26,
|
||||
"description": "\u0027When\u0027 with different variants of the arithmetic expressions (additive expression and multiplicative expression) in \u0027when condition\u0027.",
|
||||
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/10.2.kt",
|
||||
"unexpectedBehaviour": true,
|
||||
"linkType": "main",
|
||||
"helpers": "typesProvider, classes, functions"
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-201",
|
||||
"casesNumber": 23,
|
||||
"description": "\u0027When\u0027 with enumeration of the different variants of expressions in \u0027when condition\u0027.",
|
||||
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/10.1.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "main",
|
||||
"helpers": "typesProvider, classes, functions"
|
||||
}
|
||||
],
|
||||
"3": [
|
||||
{
|
||||
"specVersion": "0.1-296",
|
||||
@@ -328,6 +288,14 @@
|
||||
}
|
||||
],
|
||||
"7": [
|
||||
{
|
||||
"specVersion": "0.1-435",
|
||||
"casesNumber": 2,
|
||||
"description": "\u0027When\u0027 without bound value and with else branch in the last position.",
|
||||
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/7.2.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "main"
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-313",
|
||||
"casesNumber": 3,
|
||||
@@ -337,17 +305,25 @@
|
||||
"linkType": "main"
|
||||
}
|
||||
],
|
||||
"11": [
|
||||
{
|
||||
"specVersion": "0.1-201",
|
||||
"casesNumber": 2,
|
||||
"description": "\u0027When\u0027 with bound value and not allowed break and continue expression (without labels) in \u0027when condition\u0027.",
|
||||
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/11.1.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "main"
|
||||
}
|
||||
],
|
||||
"5": [
|
||||
{
|
||||
"specVersion": "0.1-435",
|
||||
"casesNumber": 23,
|
||||
"description": "\u0027When\u0027 with enumeration of the different variants of expressions in \u0027when condition\u0027.",
|
||||
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/5.1.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "main",
|
||||
"helpers": "typesProvider, classes, functions"
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-435",
|
||||
"casesNumber": 26,
|
||||
"description": "\u0027When\u0027 with different variants of the arithmetic expressions (additive expression and multiplicative expression) in \u0027when condition\u0027.",
|
||||
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/5.2.kt",
|
||||
"unexpectedBehaviour": true,
|
||||
"linkType": "main",
|
||||
"helpers": "typesProvider, classes, functions"
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-313",
|
||||
"casesNumber": 0,
|
||||
@@ -372,6 +348,16 @@
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "primary"
|
||||
}
|
||||
],
|
||||
"6": [
|
||||
{
|
||||
"specVersion": "0.1-435",
|
||||
"casesNumber": 2,
|
||||
"description": "\u0027When\u0027 with bound value and not allowed break and continue expression (without labels) in \u0027when condition\u0027.",
|
||||
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/6.1.kt",
|
||||
"unexpectedBehaviour": false,
|
||||
"linkType": "main"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user