diff --git a/compiler/testData/diagnostics/tests/when/AnnotatedWhenStatement.kt b/compiler/testData/diagnostics/tests/when/AnnotatedWhenStatement.kt index 9eab256fd64..dab108aef68 100644 --- a/compiler/testData/diagnostics/tests/when/AnnotatedWhenStatement.kt +++ b/compiler/testData/diagnostics/tests/when/AnnotatedWhenStatement.kt @@ -1,6 +1,6 @@ // FIR_IDENTICAL /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: pos): * - expressions, when-expression -> paragraph 9 -> sentence 2 * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression -> paragraph 6 -> sentence 5 diff --git a/compiler/testData/diagnostics/tests/when/BranchBypassVal.kt b/compiler/testData/diagnostics/tests/when/BranchBypassVal.kt index 8c8d9a6672f..73201afe66a 100644 --- a/compiler/testData/diagnostics/tests/when/BranchBypassVal.kt +++ b/compiler/testData/diagnostics/tests/when/BranchBypassVal.kt @@ -1,6 +1,6 @@ // !WITH_NEW_INFERENCE /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: neg): * - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1 * - expressions, when-expression -> paragraph 6 -> sentence 1 * - expressions, when-expression -> paragraph 5 -> sentence 1 diff --git a/compiler/testData/diagnostics/tests/when/BranchBypassVar.kt b/compiler/testData/diagnostics/tests/when/BranchBypassVar.kt index 16a084cbd74..9614dc5bb3d 100644 --- a/compiler/testData/diagnostics/tests/when/BranchBypassVar.kt +++ b/compiler/testData/diagnostics/tests/when/BranchBypassVar.kt @@ -1,6 +1,6 @@ // !WITH_NEW_INFERENCE /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: neg): * - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1 * - expressions, when-expression -> paragraph 6 -> sentence 1 * - expressions, when-expression -> paragraph 5 -> sentence 1 diff --git a/compiler/testData/diagnostics/tests/when/BranchFalseBypass.kt b/compiler/testData/diagnostics/tests/when/BranchFalseBypass.kt index 7ea30c075c8..be91b96af13 100644 --- a/compiler/testData/diagnostics/tests/when/BranchFalseBypass.kt +++ b/compiler/testData/diagnostics/tests/when/BranchFalseBypass.kt @@ -1,5 +1,5 @@ /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: pos): * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9 * - expressions, when-expression -> paragraph 6 -> sentence 1 * - expressions, when-expression -> paragraph 5 -> sentence 1 @@ -15,6 +15,6 @@ fun test(a: My): String { My.A -> q = "1" My.B -> q = "2" } - // When is exhaustives + // When is exhaustive return q } diff --git a/compiler/testData/diagnostics/tests/when/BranchFalseBypassElse.kt b/compiler/testData/diagnostics/tests/when/BranchFalseBypassElse.kt index fb48b8728cc..d3685bac5c0 100644 --- a/compiler/testData/diagnostics/tests/when/BranchFalseBypassElse.kt +++ b/compiler/testData/diagnostics/tests/when/BranchFalseBypassElse.kt @@ -1,5 +1,5 @@ /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: pos): * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 1 * - expressions, when-expression -> paragraph 6 -> sentence 1 * - expressions, when-expression -> paragraph 5 -> sentence 1 @@ -15,6 +15,6 @@ fun test(a: Any): String { is A -> q = "1" else -> q = "2" } - // When is exhaustives + // When is not exhaustive return q } diff --git a/compiler/testData/diagnostics/tests/when/CommaInWhenConditionWithoutArgument.kt b/compiler/testData/diagnostics/tests/when/CommaInWhenConditionWithoutArgument.kt index 7094e0a283e..ef290bee272 100644 --- a/compiler/testData/diagnostics/tests/when/CommaInWhenConditionWithoutArgument.kt +++ b/compiler/testData/diagnostics/tests/when/CommaInWhenConditionWithoutArgument.kt @@ -1,5 +1,5 @@ /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: pos): * - expressions, when-expression -> paragraph 2 -> sentence 1 * - expressions, when-expression -> paragraph 5 -> sentence 1 */ diff --git a/compiler/testData/diagnostics/tests/when/DuplicatedLabels.kt b/compiler/testData/diagnostics/tests/when/DuplicatedLabels.kt index 6cb2a8c6cd7..a2bf728f6b2 100644 --- a/compiler/testData/diagnostics/tests/when/DuplicatedLabels.kt +++ b/compiler/testData/diagnostics/tests/when/DuplicatedLabels.kt @@ -1,5 +1,5 @@ /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: pos): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression -> paragraph 9 -> sentence 1 * - expressions, when-expression -> paragraph 2 -> sentence 4 diff --git a/compiler/testData/diagnostics/tests/when/ElseOnNullableEnum.kt b/compiler/testData/diagnostics/tests/when/ElseOnNullableEnum.kt index bc48906435c..36abd9c1a00 100644 --- a/compiler/testData/diagnostics/tests/when/ElseOnNullableEnum.kt +++ b/compiler/testData/diagnostics/tests/when/ElseOnNullableEnum.kt @@ -1,6 +1,6 @@ // KT-2902 Check for null should be required when match nullable enum element /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: neg): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 10 diff --git a/compiler/testData/diagnostics/tests/when/ElseOnNullableEnumWithSmartCast.kt b/compiler/testData/diagnostics/tests/when/ElseOnNullableEnumWithSmartCast.kt index 3a82841e504..0a809965ace 100644 --- a/compiler/testData/diagnostics/tests/when/ElseOnNullableEnumWithSmartCast.kt +++ b/compiler/testData/diagnostics/tests/when/ElseOnNullableEnumWithSmartCast.kt @@ -1,5 +1,5 @@ /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: neg): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 10 diff --git a/compiler/testData/diagnostics/tests/when/EmptyConditionWithExpression.kt b/compiler/testData/diagnostics/tests/when/EmptyConditionWithExpression.kt index 9d67d7fb2b5..a83f30fa299 100644 --- a/compiler/testData/diagnostics/tests/when/EmptyConditionWithExpression.kt +++ b/compiler/testData/diagnostics/tests/when/EmptyConditionWithExpression.kt @@ -1,6 +1,6 @@ // FIR_IDENTICAL /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: neg): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression -> paragraph 1 -> sentence 1 * - expressions, when-expression -> paragraph 1 -> sentence 2 diff --git a/compiler/testData/diagnostics/tests/when/EmptyConditionWithExpressionEnum.kt b/compiler/testData/diagnostics/tests/when/EmptyConditionWithExpressionEnum.kt index cf1c8b3fe68..3f1b90006d2 100644 --- a/compiler/testData/diagnostics/tests/when/EmptyConditionWithExpressionEnum.kt +++ b/compiler/testData/diagnostics/tests/when/EmptyConditionWithExpressionEnum.kt @@ -1,6 +1,6 @@ // FIR_IDENTICAL /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: neg): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression -> paragraph 1 -> sentence 1 * - expressions, when-expression -> paragraph 1 -> sentence 2 diff --git a/compiler/testData/diagnostics/tests/when/ExhaustiveBoolean.kt b/compiler/testData/diagnostics/tests/when/ExhaustiveBoolean.kt index bf9803b912b..f78cf3da2b2 100644 --- a/compiler/testData/diagnostics/tests/when/ExhaustiveBoolean.kt +++ b/compiler/testData/diagnostics/tests/when/ExhaustiveBoolean.kt @@ -1,6 +1,6 @@ // FIR_IDENTICAL /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: neg): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 3 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 4 diff --git a/compiler/testData/diagnostics/tests/when/ExhaustiveBooleanBrackets.kt b/compiler/testData/diagnostics/tests/when/ExhaustiveBooleanBrackets.kt index f68dcdb5446..9a4d3e88884 100644 --- a/compiler/testData/diagnostics/tests/when/ExhaustiveBooleanBrackets.kt +++ b/compiler/testData/diagnostics/tests/when/ExhaustiveBooleanBrackets.kt @@ -1,6 +1,6 @@ // FIR_IDENTICAL /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: neg): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 3 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 4 diff --git a/compiler/testData/diagnostics/tests/when/ExhaustiveBooleanComplex.kt b/compiler/testData/diagnostics/tests/when/ExhaustiveBooleanComplex.kt index 81d5aa5ee17..4362d39de54 100644 --- a/compiler/testData/diagnostics/tests/when/ExhaustiveBooleanComplex.kt +++ b/compiler/testData/diagnostics/tests/when/ExhaustiveBooleanComplex.kt @@ -1,6 +1,6 @@ // FIR_IDENTICAL /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: neg): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 3 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 4 diff --git a/compiler/testData/diagnostics/tests/when/ExhaustiveBooleanNullable.kt b/compiler/testData/diagnostics/tests/when/ExhaustiveBooleanNullable.kt index 53a902d7d9e..d5ba8cc31b8 100644 --- a/compiler/testData/diagnostics/tests/when/ExhaustiveBooleanNullable.kt +++ b/compiler/testData/diagnostics/tests/when/ExhaustiveBooleanNullable.kt @@ -1,6 +1,6 @@ // FIR_IDENTICAL /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: neg): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 3 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 4 diff --git a/compiler/testData/diagnostics/tests/when/ExhaustiveBreakContinue.kt b/compiler/testData/diagnostics/tests/when/ExhaustiveBreakContinue.kt index 95545202ce5..0054592f87f 100644 --- a/compiler/testData/diagnostics/tests/when/ExhaustiveBreakContinue.kt +++ b/compiler/testData/diagnostics/tests/when/ExhaustiveBreakContinue.kt @@ -1,5 +1,5 @@ /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: neg): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9 * - control--and-data-flow-analysis, control-flow-graph, expressions-1, conditional-expressions -> paragraph 2 -> sentence 1 diff --git a/compiler/testData/diagnostics/tests/when/ExhaustiveEnumIs.kt b/compiler/testData/diagnostics/tests/when/ExhaustiveEnumIs.kt index cdb933eb240..784ccb97825 100644 --- a/compiler/testData/diagnostics/tests/when/ExhaustiveEnumIs.kt +++ b/compiler/testData/diagnostics/tests/when/ExhaustiveEnumIs.kt @@ -1,5 +1,5 @@ /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: neg): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression -> paragraph 6 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9 diff --git a/compiler/testData/diagnostics/tests/when/ExhaustiveEnumMixed.kt b/compiler/testData/diagnostics/tests/when/ExhaustiveEnumMixed.kt index c56933375f4..a93f12186ce 100644 --- a/compiler/testData/diagnostics/tests/when/ExhaustiveEnumMixed.kt +++ b/compiler/testData/diagnostics/tests/when/ExhaustiveEnumMixed.kt @@ -1,5 +1,5 @@ /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: neg): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression -> paragraph 6 -> sentence 1 * - expressions, when-expression -> paragraph 6 -> sentence 5 diff --git a/compiler/testData/diagnostics/tests/when/ExhaustiveInitialization.kt b/compiler/testData/diagnostics/tests/when/ExhaustiveInitialization.kt index 7cf0d18514f..6ab1e7a5b8a 100644 --- a/compiler/testData/diagnostics/tests/when/ExhaustiveInitialization.kt +++ b/compiler/testData/diagnostics/tests/when/ExhaustiveInitialization.kt @@ -1,5 +1,5 @@ /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: pos): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression -> paragraph 6 -> sentence 5 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9 diff --git a/compiler/testData/diagnostics/tests/when/ExhaustiveNoInitialization.kt b/compiler/testData/diagnostics/tests/when/ExhaustiveNoInitialization.kt index ceb6ff9403e..5178fa1c6c2 100644 --- a/compiler/testData/diagnostics/tests/when/ExhaustiveNoInitialization.kt +++ b/compiler/testData/diagnostics/tests/when/ExhaustiveNoInitialization.kt @@ -1,5 +1,5 @@ /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: pos): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 3 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 4 diff --git a/compiler/testData/diagnostics/tests/when/ExhaustiveNullable.kt b/compiler/testData/diagnostics/tests/when/ExhaustiveNullable.kt index e0e5ed4424d..03a4fd5548d 100644 --- a/compiler/testData/diagnostics/tests/when/ExhaustiveNullable.kt +++ b/compiler/testData/diagnostics/tests/when/ExhaustiveNullable.kt @@ -1,5 +1,5 @@ /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: pos): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 10 diff --git a/compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnum.kt b/compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnum.kt index da3ede407d4..5593a829de7 100644 --- a/compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnum.kt +++ b/compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnum.kt @@ -1,5 +1,5 @@ /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: pos): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9 */ diff --git a/compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumAnnotated.kt b/compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumAnnotated.kt index bd3608dd00e..1cb3793053b 100644 --- a/compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumAnnotated.kt +++ b/compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumAnnotated.kt @@ -1,6 +1,6 @@ // FIR_IDENTICAL /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: pos): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9 */ diff --git a/compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumElse.kt b/compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumElse.kt index 9abfea20185..0b1b4f18423 100644 --- a/compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumElse.kt +++ b/compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumElse.kt @@ -1,6 +1,6 @@ // FIR_IDENTICAL /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: pos): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9 diff --git a/compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumNull.kt b/compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumNull.kt index 073be24a263..b9b56751c04 100644 --- a/compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumNull.kt +++ b/compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumNull.kt @@ -1,6 +1,6 @@ // FIR_IDENTICAL /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: pos): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 10 diff --git a/compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumStatement.kt b/compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumStatement.kt index b0fa7677b3f..2c0b3db8268 100644 --- a/compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumStatement.kt +++ b/compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumStatement.kt @@ -1,5 +1,5 @@ /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: pos): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9 */ diff --git a/compiler/testData/diagnostics/tests/when/ExhaustiveReturn.kt b/compiler/testData/diagnostics/tests/when/ExhaustiveReturn.kt index 7a0945ca2a7..c9bab9edfda 100644 --- a/compiler/testData/diagnostics/tests/when/ExhaustiveReturn.kt +++ b/compiler/testData/diagnostics/tests/when/ExhaustiveReturn.kt @@ -1,5 +1,5 @@ /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: pos): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9 * - control--and-data-flow-analysis, control-flow-graph, expressions-1, conditional-expressions -> paragraph 2 -> sentence 1 diff --git a/compiler/testData/diagnostics/tests/when/ExhaustiveReturnThrow.kt b/compiler/testData/diagnostics/tests/when/ExhaustiveReturnThrow.kt index 4ee8fb00b47..1d6f3b98c06 100644 --- a/compiler/testData/diagnostics/tests/when/ExhaustiveReturnThrow.kt +++ b/compiler/testData/diagnostics/tests/when/ExhaustiveReturnThrow.kt @@ -1,5 +1,5 @@ /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: pos): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9 * - control--and-data-flow-analysis, control-flow-graph, expressions-1, conditional-expressions -> paragraph 2 -> sentence 1 diff --git a/compiler/testData/diagnostics/tests/when/ExhaustiveValOverConditionalInit.kt b/compiler/testData/diagnostics/tests/when/ExhaustiveValOverConditionalInit.kt index 059949c0482..b5f44c03031 100644 --- a/compiler/testData/diagnostics/tests/when/ExhaustiveValOverConditionalInit.kt +++ b/compiler/testData/diagnostics/tests/when/ExhaustiveValOverConditionalInit.kt @@ -1,5 +1,5 @@ /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: neg): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 3 * - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 1 diff --git a/compiler/testData/diagnostics/tests/when/ExhaustiveVarOverConditionalInit.kt b/compiler/testData/diagnostics/tests/when/ExhaustiveVarOverConditionalInit.kt index d4821881a1b..d41e768a31b 100644 --- a/compiler/testData/diagnostics/tests/when/ExhaustiveVarOverConditionalInit.kt +++ b/compiler/testData/diagnostics/tests/when/ExhaustiveVarOverConditionalInit.kt @@ -1,5 +1,5 @@ /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: neg): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 3 * - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 1 diff --git a/compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheck.kt b/compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheck.kt index d3de81349a2..ad43d12985e 100644 --- a/compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheck.kt +++ b/compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheck.kt @@ -1,5 +1,5 @@ /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: pos): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9 * - type-inference, smart-casts, smart-cast-types -> paragraph 9 -> sentence 1 diff --git a/compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckBefore.kt b/compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckBefore.kt index 5254d3728b8..9f6a69df814 100644 --- a/compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckBefore.kt +++ b/compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckBefore.kt @@ -1,5 +1,5 @@ /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: pos): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9 * - type-inference, smart-casts, smart-cast-types -> paragraph 9 -> sentence 1 diff --git a/compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckBoolean.kt b/compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckBoolean.kt index 70a2bd40a8e..2cc4c61317c 100644 --- a/compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckBoolean.kt +++ b/compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckBoolean.kt @@ -1,5 +1,5 @@ /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: pos): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 3 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 4 diff --git a/compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckElse.kt b/compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckElse.kt index cea7c51ba4b..e4fac1119d5 100644 --- a/compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckElse.kt +++ b/compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckElse.kt @@ -1,5 +1,5 @@ /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: pos): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9 * - type-inference, smart-casts, smart-cast-types -> paragraph 9 -> sentence 1 diff --git a/compiler/testData/diagnostics/tests/when/NoElseExpectedUnit.kt b/compiler/testData/diagnostics/tests/when/NoElseExpectedUnit.kt index 9df5ef3bb3b..2b63db3548d 100644 --- a/compiler/testData/diagnostics/tests/when/NoElseExpectedUnit.kt +++ b/compiler/testData/diagnostics/tests/when/NoElseExpectedUnit.kt @@ -1,5 +1,5 @@ /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: neg): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression -> paragraph 9 -> sentence 2 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1 diff --git a/compiler/testData/diagnostics/tests/when/NoElseNoExpectedType.kt b/compiler/testData/diagnostics/tests/when/NoElseNoExpectedType.kt index 2f738c0c335..f15a1c05958 100644 --- a/compiler/testData/diagnostics/tests/when/NoElseNoExpectedType.kt +++ b/compiler/testData/diagnostics/tests/when/NoElseNoExpectedType.kt @@ -1,5 +1,5 @@ /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: neg): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression -> paragraph 9 -> sentence 2 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1 diff --git a/compiler/testData/diagnostics/tests/when/NoElseReturnedCoercionToUnit.kt b/compiler/testData/diagnostics/tests/when/NoElseReturnedCoercionToUnit.kt index 096513ac0f6..cb32e058d23 100644 --- a/compiler/testData/diagnostics/tests/when/NoElseReturnedCoercionToUnit.kt +++ b/compiler/testData/diagnostics/tests/when/NoElseReturnedCoercionToUnit.kt @@ -1,5 +1,5 @@ /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: neg): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression -> paragraph 9 -> sentence 2 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1 diff --git a/compiler/testData/diagnostics/tests/when/NoElseReturnedFromLambdaExpectedInt.kt b/compiler/testData/diagnostics/tests/when/NoElseReturnedFromLambdaExpectedInt.kt index 745e354bde2..80bd63ef9b3 100644 --- a/compiler/testData/diagnostics/tests/when/NoElseReturnedFromLambdaExpectedInt.kt +++ b/compiler/testData/diagnostics/tests/when/NoElseReturnedFromLambdaExpectedInt.kt @@ -1,5 +1,5 @@ /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: neg): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression -> paragraph 9 -> sentence 2 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1 diff --git a/compiler/testData/diagnostics/tests/when/NoElseReturnedNonUnit.kt b/compiler/testData/diagnostics/tests/when/NoElseReturnedNonUnit.kt index 8b921a2cb9f..da30bade9e3 100644 --- a/compiler/testData/diagnostics/tests/when/NoElseReturnedNonUnit.kt +++ b/compiler/testData/diagnostics/tests/when/NoElseReturnedNonUnit.kt @@ -1,5 +1,5 @@ /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: neg): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression -> paragraph 9 -> sentence 2 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1 diff --git a/compiler/testData/diagnostics/tests/when/NoElseReturnedUnit.kt b/compiler/testData/diagnostics/tests/when/NoElseReturnedUnit.kt index 23dbd7f887e..9f340861986 100644 --- a/compiler/testData/diagnostics/tests/when/NoElseReturnedUnit.kt +++ b/compiler/testData/diagnostics/tests/when/NoElseReturnedUnit.kt @@ -1,5 +1,5 @@ /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: neg): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression -> paragraph 9 -> sentence 2 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1 diff --git a/compiler/testData/diagnostics/tests/when/NoElseWhenStatement.kt b/compiler/testData/diagnostics/tests/when/NoElseWhenStatement.kt index b2f192fdb66..c0daafb57e6 100644 --- a/compiler/testData/diagnostics/tests/when/NoElseWhenStatement.kt +++ b/compiler/testData/diagnostics/tests/when/NoElseWhenStatement.kt @@ -1,6 +1,6 @@ // FIR_IDENTICAL /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: pos): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression -> paragraph 9 -> sentence 2 */ diff --git a/compiler/testData/diagnostics/tests/when/NonExhaustiveBooleanNullable.kt b/compiler/testData/diagnostics/tests/when/NonExhaustiveBooleanNullable.kt index 5cea7ab9a56..223b4b60cd6 100644 --- a/compiler/testData/diagnostics/tests/when/NonExhaustiveBooleanNullable.kt +++ b/compiler/testData/diagnostics/tests/when/NonExhaustiveBooleanNullable.kt @@ -1,5 +1,5 @@ /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: pos): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 3 diff --git a/compiler/testData/diagnostics/tests/when/NonExhaustivePlatformEnum.kt b/compiler/testData/diagnostics/tests/when/NonExhaustivePlatformEnum.kt index 472c6d4ec32..0c99aceb3a0 100644 --- a/compiler/testData/diagnostics/tests/when/NonExhaustivePlatformEnum.kt +++ b/compiler/testData/diagnostics/tests/when/NonExhaustivePlatformEnum.kt @@ -1,5 +1,5 @@ /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: neg): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9 diff --git a/compiler/testData/diagnostics/tests/when/NonExhaustiveWarning.kt b/compiler/testData/diagnostics/tests/when/NonExhaustiveWarning.kt index b11dd3c4a39..19287f9664a 100644 --- a/compiler/testData/diagnostics/tests/when/NonExhaustiveWarning.kt +++ b/compiler/testData/diagnostics/tests/when/NonExhaustiveWarning.kt @@ -1,5 +1,5 @@ /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: neg): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9 diff --git a/compiler/testData/diagnostics/tests/when/NonExhaustiveWarningElse.kt b/compiler/testData/diagnostics/tests/when/NonExhaustiveWarningElse.kt index 1dc9dbed689..db50402e545 100644 --- a/compiler/testData/diagnostics/tests/when/NonExhaustiveWarningElse.kt +++ b/compiler/testData/diagnostics/tests/when/NonExhaustiveWarningElse.kt @@ -1,6 +1,6 @@ // FIR_IDENTICAL /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: neg): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 1 diff --git a/compiler/testData/diagnostics/tests/when/NonExhaustiveWarningFalse.kt b/compiler/testData/diagnostics/tests/when/NonExhaustiveWarningFalse.kt index 2f927561bab..389ec766181 100644 --- a/compiler/testData/diagnostics/tests/when/NonExhaustiveWarningFalse.kt +++ b/compiler/testData/diagnostics/tests/when/NonExhaustiveWarningFalse.kt @@ -1,5 +1,5 @@ /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: neg): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9 * - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 1 diff --git a/compiler/testData/diagnostics/tests/when/NonExhaustiveWarningForSealedClass.kt b/compiler/testData/diagnostics/tests/when/NonExhaustiveWarningForSealedClass.kt index fd5d3dbae14..3fe4dd75743 100644 --- a/compiler/testData/diagnostics/tests/when/NonExhaustiveWarningForSealedClass.kt +++ b/compiler/testData/diagnostics/tests/when/NonExhaustiveWarningForSealedClass.kt @@ -1,5 +1,5 @@ /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: neg): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 6 diff --git a/compiler/testData/diagnostics/tests/when/NonExhaustiveWarningNull.kt b/compiler/testData/diagnostics/tests/when/NonExhaustiveWarningNull.kt index 1691f8812dc..42b5d3fe696 100644 --- a/compiler/testData/diagnostics/tests/when/NonExhaustiveWarningNull.kt +++ b/compiler/testData/diagnostics/tests/when/NonExhaustiveWarningNull.kt @@ -1,6 +1,6 @@ // FIR_IDENTICAL /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: neg): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9 diff --git a/compiler/testData/diagnostics/tests/when/NonExhaustiveWithNullabilityCheck.kt b/compiler/testData/diagnostics/tests/when/NonExhaustiveWithNullabilityCheck.kt index dc7a4ab0956..519ed0ba2e3 100644 --- a/compiler/testData/diagnostics/tests/when/NonExhaustiveWithNullabilityCheck.kt +++ b/compiler/testData/diagnostics/tests/when/NonExhaustiveWithNullabilityCheck.kt @@ -1,5 +1,5 @@ /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: neg): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9 diff --git a/compiler/testData/diagnostics/tests/when/PropertyNotInitialized.kt b/compiler/testData/diagnostics/tests/when/PropertyNotInitialized.kt index 258d9b997f2..4cfd18a3ca5 100644 --- a/compiler/testData/diagnostics/tests/when/PropertyNotInitialized.kt +++ b/compiler/testData/diagnostics/tests/when/PropertyNotInitialized.kt @@ -1,5 +1,5 @@ /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: neg): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9 * - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 1 diff --git a/compiler/testData/diagnostics/tests/when/RedundantElse.kt b/compiler/testData/diagnostics/tests/when/RedundantElse.kt index 72d6fec511b..e521c9acf56 100644 --- a/compiler/testData/diagnostics/tests/when/RedundantElse.kt +++ b/compiler/testData/diagnostics/tests/when/RedundantElse.kt @@ -1,5 +1,5 @@ /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: neg): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 3 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 6 diff --git a/compiler/testData/diagnostics/tests/when/ReservedExhaustiveWhen.kt b/compiler/testData/diagnostics/tests/when/ReservedExhaustiveWhen.kt index 03599a12c51..bf9817af3f2 100644 --- a/compiler/testData/diagnostics/tests/when/ReservedExhaustiveWhen.kt +++ b/compiler/testData/diagnostics/tests/when/ReservedExhaustiveWhen.kt @@ -1,5 +1,5 @@ /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: neg): * - expressions, when-expression -> paragraph 2 -> sentence 1 * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 1 diff --git a/compiler/testData/diagnostics/tests/when/TopLevelSealed.kt b/compiler/testData/diagnostics/tests/when/TopLevelSealed.kt index 61c2344d0b8..bedb452b828 100644 --- a/compiler/testData/diagnostics/tests/when/TopLevelSealed.kt +++ b/compiler/testData/diagnostics/tests/when/TopLevelSealed.kt @@ -1,6 +1,6 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: neg): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression -> paragraph 6 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 6 diff --git a/compiler/testData/diagnostics/tests/when/When.kt b/compiler/testData/diagnostics/tests/when/When.kt index b7ceebd10b0..a7b376993cc 100644 --- a/compiler/testData/diagnostics/tests/when/When.kt +++ b/compiler/testData/diagnostics/tests/when/When.kt @@ -1,6 +1,6 @@ // !WITH_NEW_INFERENCE /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: neg): * - expressions, when-expression -> paragraph 2 -> sentence 5 * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression -> paragraph 6 -> sentence 1 diff --git a/compiler/testData/diagnostics/tests/when/WhenTypeDisjunctions.kt b/compiler/testData/diagnostics/tests/when/WhenTypeDisjunctions.kt index 599a88ead5a..dedb648265b 100644 --- a/compiler/testData/diagnostics/tests/when/WhenTypeDisjunctions.kt +++ b/compiler/testData/diagnostics/tests/when/WhenTypeDisjunctions.kt @@ -1,5 +1,5 @@ /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: neg): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - type-inference, smart-casts, smart-cast-types -> paragraph 9 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 1 diff --git a/compiler/testData/diagnostics/tests/when/kt10439.kt b/compiler/testData/diagnostics/tests/when/kt10439.kt index c73f5c2be66..5178f8b49b0 100644 --- a/compiler/testData/diagnostics/tests/when/kt10439.kt +++ b/compiler/testData/diagnostics/tests/when/kt10439.kt @@ -1,6 +1,6 @@ // !WITH_NEW_INFERENCE /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: pos): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression -> paragraph 9 -> sentence 1 * - expressions, conditional-expression -> paragraph 4 -> sentence 1 diff --git a/compiler/testData/diagnostics/tests/when/kt10809.kt b/compiler/testData/diagnostics/tests/when/kt10809.kt index 820ceb4c9b1..efc1a11f6f0 100644 --- a/compiler/testData/diagnostics/tests/when/kt10809.kt +++ b/compiler/testData/diagnostics/tests/when/kt10809.kt @@ -2,7 +2,7 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -DEBUG_INFO_SMARTCAST // NI_EXPECTED_FILE /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: pos): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression -> paragraph 6 -> sentence 1 * - expressions, when-expression -> paragraph 2 -> sentence 1 diff --git a/compiler/testData/diagnostics/tests/when/kt10811.kt b/compiler/testData/diagnostics/tests/when/kt10811.kt index 7c5b1fdd699..479de475679 100644 --- a/compiler/testData/diagnostics/tests/when/kt10811.kt +++ b/compiler/testData/diagnostics/tests/when/kt10811.kt @@ -1,6 +1,6 @@ // FIR_IDENTICAL /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: pos): * - expressions, when-expression -> paragraph 2 -> sentence 1 * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 1 diff --git a/compiler/testData/diagnostics/tests/when/kt4434.kt b/compiler/testData/diagnostics/tests/when/kt4434.kt index be0d1e00df3..63ab94d3fd3 100644 --- a/compiler/testData/diagnostics/tests/when/kt4434.kt +++ b/compiler/testData/diagnostics/tests/when/kt4434.kt @@ -1,5 +1,5 @@ /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: pos): * - expressions, when-expression -> paragraph 5 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 1 diff --git a/compiler/testData/diagnostics/tests/when/kt9972.kt b/compiler/testData/diagnostics/tests/when/kt9972.kt index 1a950e4cbb4..88c53de95fd 100644 --- a/compiler/testData/diagnostics/tests/when/kt9972.kt +++ b/compiler/testData/diagnostics/tests/when/kt9972.kt @@ -1,6 +1,6 @@ // !WITH_NEW_INFERENCE /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: pos): * - expressions, when-expression -> paragraph 2 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 1 * - expressions, when-expression -> paragraph 9 -> sentence 1 diff --git a/compiler/testData/diagnostics/tests/when/whenAndLambdaWithExpectedType.kt b/compiler/testData/diagnostics/tests/when/whenAndLambdaWithExpectedType.kt index 72c6dc575c7..598e289ad7c 100644 --- a/compiler/testData/diagnostics/tests/when/whenAndLambdaWithExpectedType.kt +++ b/compiler/testData/diagnostics/tests/when/whenAndLambdaWithExpectedType.kt @@ -1,6 +1,6 @@ // !WITH_NEW_INFERENCE /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: neg): * - expressions, when-expression -> paragraph 2 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 1 * - type-system, subtyping, subtyping-rules -> paragraph 2 -> sentence 1 diff --git a/compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.kt b/compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.kt index 2bb1ec1d644..34a502648dd 100644 --- a/compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.kt +++ b/compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.kt @@ -1,7 +1,7 @@ // !WITH_NEW_INFERENCE // NI_EXPECTED_FILE /* - * RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg): + * RELEVANT SPEC SENTENCES (spec version: 0.1-152, test type: neg): * - expressions, when-expression -> paragraph 2 -> sentence 1 * - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 1 * - declarations, function-declaration -> paragraph 7 -> sentence 1 diff --git a/compiler/tests-spec/build.gradle.kts b/compiler/tests-spec/build.gradle.kts index bcf7e2962ed..97305a4f71e 100644 --- a/compiler/tests-spec/build.gradle.kts +++ b/compiler/tests-spec/build.gradle.kts @@ -28,8 +28,6 @@ val generateFeatureInteractionSpecTestData by generator("org.jetbrains.kotlin.sp val printSpecTestsStatistic by generator("org.jetbrains.kotlin.spec.utils.tasks.PrintSpecTestsStatisticKt") -val generateJsonTestsMap by generator("org.jetbrains.kotlin.spec.utils.tasks.GenerateJsonTestsMapKt") - val remoteRunTests by task { val packagePrefix = "org.jetbrains.kotlin.spec." val includeTests = setOf( 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 index c6e71711d2c..c5ae71cdc47 100644 --- 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 @@ -10,6 +10,6 @@ Exception Details: locals: { uninitializedThis } stack: { uninitializedThis, uninitializedThis } Bytecode: - 0x0000000: 2a2a c000 02b6 000a b700 0db1 + 0000000: 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/16.exceptions.runtime.txt b/compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/16.exceptions.runtime.txt index 7099f46139e..40120d21c3d 100644 --- 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 @@ -10,6 +10,6 @@ Exception Details: locals: { uninitializedThis } stack: { uninitializedThis, uninitializedThis } Bytecode: - 0x0000000: 2a2a c000 02b6 000a b700 0db1 + 0000000: 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 index 7fe0d2bfc7a..18be28f2284 100644 --- 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 @@ -10,6 +10,6 @@ Exception Details: locals: { uninitializedThis } stack: { uninitializedThis, uninitializedThis } Bytecode: - 0x0000000: 2a2a c000 02b6 000a b700 0db1 + 0000000: 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/9.exceptions.runtime.txt b/compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/9.exceptions.runtime.txt index 97b60986bb1..7dbd9379770 100644 --- a/compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/9.exceptions.runtime.txt +++ b/compiler/tests-spec/testData/codegen/box/notLinked/objects/inheritance/neg/9.exceptions.runtime.txt @@ -10,6 +10,6 @@ Exception Details: locals: { uninitializedThis } stack: { uninitializedThis, uninitializedThis } Bytecode: - 0x0000000: 2a2a b700 09b1 + 0000000: 2a2a b700 09b1 Foo.(9.kt) \ No newline at end of file diff --git a/compiler/tests-spec/testData/diagnostics/linked/annotations/annotation-targets/testsMap.json b/compiler/tests-spec/testData/diagnostics/linked/annotations/annotation-targets/testsMap.json index 019e1cc9724..500e32b727d 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/annotations/annotation-targets/testsMap.json +++ b/compiler/tests-spec/testData/diagnostics/linked/annotations/annotation-targets/testsMap.json @@ -3,7 +3,7 @@ "pos": { "1": [ { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Annotated when statement", "path": "compiler/testData/diagnostics/tests/when/AnnotatedWhenStatement.kt", diff --git a/compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/performing-analysis-on-the-control-flow-graph/variable-initialization-analysis/testsMap.json b/compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/performing-analysis-on-the-control-flow-graph/variable-initialization-analysis/testsMap.json index a46a061a597..f189ccbaa8b 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/performing-analysis-on-the-control-flow-graph/variable-initialization-analysis/testsMap.json +++ b/compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/performing-analysis-on-the-control-flow-graph/variable-initialization-analysis/testsMap.json @@ -3,49 +3,49 @@ "neg": { "1": [ { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Non exhaustive warning null", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningNull.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Non exhaustive warning", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarning.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive val over conditional init", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveValOverConditionalInit.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Non exhaustive warning false", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningFalse.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive var over conditional init", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveVarOverConditionalInit.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Property not initialized", "path": "compiler/testData/diagnostics/tests/when/PropertyNotInitialized.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Non exhaustive warning else", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningElse.kt", @@ -54,49 +54,49 @@ ], "3": [ { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Non exhaustive warning null", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningNull.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Non exhaustive warning", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarning.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive val over conditional init", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveValOverConditionalInit.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Non exhaustive warning false", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningFalse.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive var over conditional init", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveVarOverConditionalInit.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Property not initialized", "path": "compiler/testData/diagnostics/tests/when/PropertyNotInitialized.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Non exhaustive warning else", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningElse.kt", @@ -107,21 +107,21 @@ "pos": { "1": [ { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive nullable", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveNullable.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive initialization", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveInitialization.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive no initialization", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveNoInitialization.kt", @@ -130,21 +130,21 @@ ], "3": [ { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive nullable", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveNullable.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive initialization", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveInitialization.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive no initialization", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveNoInitialization.kt", @@ -157,35 +157,35 @@ "neg": { "2": [ { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive val over conditional init", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveValOverConditionalInit.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Non exhaustive warning false", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningFalse.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive var over conditional init", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveVarOverConditionalInit.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Property not initialized", "path": "compiler/testData/diagnostics/tests/when/PropertyNotInitialized.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Non exhaustive warning else", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningElse.kt", @@ -194,7 +194,7 @@ ], "3": [ { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive val over conditional init", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveValOverConditionalInit.kt", diff --git a/compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/classifier-initialization/testsMap.json b/compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/classifier-initialization/testsMap.json index 5faf143d208..716d3828e6f 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/classifier-initialization/testsMap.json +++ b/compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/classifier-initialization/testsMap.json @@ -3,7 +3,7 @@ "neg": { "4": [ { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Property not initialized", "path": "compiler/testData/diagnostics/tests/when/PropertyNotInitialized.kt", diff --git a/compiler/tests-spec/testData/diagnostics/linked/declarations/function-declaration/testsMap.json b/compiler/tests-spec/testData/diagnostics/linked/declarations/function-declaration/testsMap.json index 0f532f9541b..bbbbf8bd639 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/declarations/function-declaration/testsMap.json +++ b/compiler/tests-spec/testData/diagnostics/linked/declarations/function-declaration/testsMap.json @@ -3,7 +3,7 @@ "pos": { "1": [ { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Kt10809", "path": "compiler/testData/diagnostics/tests/when/kt10809.kt", @@ -14,7 +14,7 @@ "neg": { "1": [ { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "When with nothing and lambdas", "path": "compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.kt", @@ -23,7 +23,7 @@ ], "2": [ { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "When with nothing and lambdas", "path": "compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.kt", @@ -36,7 +36,7 @@ "neg": { "1": [ { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "When with nothing and lambdas", "path": "compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.kt", diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/function-literals/lambda-literals/testsMap.json b/compiler/tests-spec/testData/diagnostics/linked/expressions/function-literals/lambda-literals/testsMap.json index cda30162670..e76c1486935 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/function-literals/lambda-literals/testsMap.json +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/function-literals/lambda-literals/testsMap.json @@ -3,14 +3,14 @@ "neg": { "1": [ { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "No else returned coercion to unit", "path": "compiler/testData/diagnostics/tests/when/NoElseReturnedCoercionToUnit.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "No else returned from lambda expected int", "path": "compiler/testData/diagnostics/tests/when/NoElseReturnedFromLambdaExpectedInt.kt", diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/testsMap.json b/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/testsMap.json index b04e25ac1e3..3be3afac23f 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/testsMap.json +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/testsMap.json @@ -21,28 +21,28 @@ "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive boolean nullable", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanNullable.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Non exhaustive warning null", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningNull.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Else on nullable enum", "path": "compiler/testData/diagnostics/tests/when/ElseOnNullableEnum.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Else on nullable enum with smart cast", "path": "compiler/testData/diagnostics/tests/when/ElseOnNullableEnumWithSmartCast.kt", @@ -63,35 +63,35 @@ "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "When and lambda with expected type", "path": "compiler/testData/diagnostics/tests/when/whenAndLambdaWithExpectedType.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "When type disjunctions", "path": "compiler/testData/diagnostics/tests/when/WhenTypeDisjunctions.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Reserved exhaustive when", "path": "compiler/testData/diagnostics/tests/when/ReservedExhaustiveWhen.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Non exhaustive warning else", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningElse.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "When with nothing and lambdas", "path": "compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.kt", @@ -106,49 +106,49 @@ "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive boolean nullable", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanNullable.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive val over conditional init", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveValOverConditionalInit.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive boolean brackets", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanBrackets.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive boolean complex", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanComplex.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive boolean", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveBoolean.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive var over conditional init", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveVarOverConditionalInit.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Redundant else", "path": "compiler/testData/diagnostics/tests/when/RedundantElse.kt", @@ -163,21 +163,21 @@ "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Non exhaustive warning for sealed class", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningForSealedClass.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Redundant else", "path": "compiler/testData/diagnostics/tests/when/RedundantElse.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Top level sealed", "path": "compiler/testData/diagnostics/tests/when/TopLevelSealed.kt", @@ -186,28 +186,28 @@ ], "4": [ { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive boolean nullable", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanNullable.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive boolean brackets", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanBrackets.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive boolean complex", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanComplex.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive boolean", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveBoolean.kt", @@ -216,91 +216,91 @@ ], "9": [ { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Non exhaustive warning null", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningNull.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Non exhaustive warning", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarning.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Non exhaustive warning false", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningFalse.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Non exhaustive platform enum", "path": "compiler/testData/diagnostics/tests/when/NonExhaustivePlatformEnum.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive enum mixed", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveEnumMixed.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Property not initialized", "path": "compiler/testData/diagnostics/tests/when/PropertyNotInitialized.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Non exhaustive warning else", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningElse.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Redundant else", "path": "compiler/testData/diagnostics/tests/when/RedundantElse.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Non exhaustive with nullability check", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWithNullabilityCheck.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive enum is", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveEnumIs.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive break continue", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveBreakContinue.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Else on nullable enum", "path": "compiler/testData/diagnostics/tests/when/ElseOnNullableEnum.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Else on nullable enum with smart cast", "path": "compiler/testData/diagnostics/tests/when/ElseOnNullableEnumWithSmartCast.kt", @@ -309,21 +309,21 @@ ], "5": [ { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive boolean brackets", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanBrackets.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive boolean complex", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanComplex.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive boolean", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveBoolean.kt", @@ -332,14 +332,14 @@ ], "7": [ { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Non exhaustive warning for sealed class", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningForSealedClass.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Top level sealed", "path": "compiler/testData/diagnostics/tests/when/TopLevelSealed.kt", @@ -348,7 +348,7 @@ ], "8": [ { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Top level sealed", "path": "compiler/testData/diagnostics/tests/when/TopLevelSealed.kt", @@ -377,21 +377,21 @@ "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive nullable", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveNullable.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Non exhaustive boolean nullable", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveBooleanNullable.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive platform enum null", "path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumNull.kt", @@ -418,49 +418,49 @@ "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive platform enum else", "path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumElse.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Kt9929", "path": "compiler/testData/diagnostics/tests/when/kt9929.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Kt4434", "path": "compiler/testData/diagnostics/tests/when/kt4434.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Kt10811", "path": "compiler/testData/diagnostics/tests/when/kt10811.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Kt9972", "path": "compiler/testData/diagnostics/tests/when/kt9972.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Branch false bypass else", "path": "compiler/testData/diagnostics/tests/when/BranchFalseBypassElse.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Kt10809", "path": "compiler/testData/diagnostics/tests/when/kt10809.kt", @@ -475,21 +475,21 @@ "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive with nullability check boolean", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckBoolean.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Non exhaustive boolean nullable", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveBooleanNullable.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive no initialization", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveNoInitialization.kt", @@ -514,91 +514,91 @@ ], "9": [ { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive platform enum else", "path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumElse.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Branch false bypass", "path": "compiler/testData/diagnostics/tests/when/BranchFalseBypass.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive with nullability check before", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckBefore.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive with nullability check else", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckElse.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive platform enum statement", "path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumStatement.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive platform enum", "path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnum.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive nullable", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveNullable.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive initialization", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveInitialization.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive with nullability check", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheck.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive platform enum annotated", "path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumAnnotated.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive return throw", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveReturnThrow.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive return", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveReturn.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive platform enum null", "path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumNull.kt", @@ -607,14 +607,14 @@ ], "4": [ { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive with nullability check boolean", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckBoolean.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive no initialization", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveNoInitialization.kt", @@ -623,14 +623,14 @@ ], "5": [ { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive with nullability check boolean", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckBoolean.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive no initialization", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveNoInitialization.kt", @@ -643,21 +643,21 @@ "pos": { "1": [ { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Kt9929", "path": "compiler/testData/diagnostics/tests/when/kt9929.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Kt4434", "path": "compiler/testData/diagnostics/tests/when/kt4434.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Non exhaustive boolean nullable", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveBooleanNullable.kt", @@ -668,91 +668,91 @@ "neg": { "1": [ { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Non exhaustive warning null", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningNull.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "No else returned unit", "path": "compiler/testData/diagnostics/tests/when/NoElseReturnedUnit.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "No else expected unit", "path": "compiler/testData/diagnostics/tests/when/NoElseExpectedUnit.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Branch bypass val", "path": "compiler/testData/diagnostics/tests/when/BranchBypassVal.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Non exhaustive warning", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarning.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "No else returned coercion to unit", "path": "compiler/testData/diagnostics/tests/when/NoElseReturnedCoercionToUnit.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Non exhaustive warning for sealed class", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningForSealedClass.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Branch bypass var", "path": "compiler/testData/diagnostics/tests/when/BranchBypassVar.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Non exhaustive platform enum", "path": "compiler/testData/diagnostics/tests/when/NonExhaustivePlatformEnum.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "No else returned from lambda expected int", "path": "compiler/testData/diagnostics/tests/when/NoElseReturnedFromLambdaExpectedInt.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Non exhaustive with nullability check", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWithNullabilityCheck.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "No else no expected type", "path": "compiler/testData/diagnostics/tests/when/NoElseNoExpectedType.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "No else returned non unit", "path": "compiler/testData/diagnostics/tests/when/NoElseReturnedNonUnit.kt", @@ -765,7 +765,7 @@ "neg": { "1": [ { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Non exhaustive warning for sealed class", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningForSealedClass.kt", diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/11.1.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/11.1.kt index 29ebb91f885..351fe982833 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/11.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/11.1.kt @@ -1,33 +1,35 @@ +// !DIAGNOSTICS: -UNUSED_VALUE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE // SKIP_TXT /* * KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE) * - * SPEC VERSION: 0.1-100 + * SPEC VERSION: 0.1-201 * PLACE: expressions, when-expression -> paragraph 6 -> sentence 11 * NUMBER: 1 - * DESCRIPTION: 'When' without bound value and with 'else' branch not in the last position. + * DESCRIPTION: 'When' with bound value and non-expressions in 'when condition'. */ // TESTCASE NUMBER: 1 -fun case_1(value_1: Int): String = when { - else -> "" - value_1 == 1 -> "" -} - -// TESTCASE NUMBER: 2 -fun case_2(value_1: Int): String = when { - value_1 == 1 -> "" - else -> "" - value_1 == 2 -> "" -} - -// TESTCASE NUMBER: 3 -fun case_3(): String { - when { - else -> return "" - else -> return "" +fun case_1(value_1: Int, value_2: List): String { + when (value_1) { + while (false) {} -> return "" + do {} while (false) -> return "" + for (value in value_2) {} -> return "" } - return "" + return "" } + +// TESTCASE NUMBER: 4 +fun case_4(value_1: Int): String { + var value_2: Int + var value_3 = 10 + + when (value_1) { + value_2 = 10 -> return "" + value_3 %= 10 -> return "" + } + + return "" +} \ No newline at end of file diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/9.2.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/11.2.kt similarity index 96% rename from compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/9.2.kt rename to compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/11.2.kt index 3690ac3da2f..4b72f0a2be9 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/9.2.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/11.2.kt @@ -3,8 +3,8 @@ /* * KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE) * - * SPEC VERSION: 0.1-100 - * PLACE: expressions, when-expression -> paragraph 6 -> sentence 9 + * SPEC VERSION: 0.1-201 + * PLACE: expressions, when-expression -> paragraph 6 -> sentence 11 * NUMBER: 2 * DESCRIPTION: 'When' with bound value and not allowed break and continue expression (without labels) in 'when condition'. */ diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/12.1.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/12.1.kt new file mode 100644 index 00000000000..be387d634f5 --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/12.1.kt @@ -0,0 +1,33 @@ +// SKIP_TXT + +/* + * KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE) + * + * SPEC VERSION: 0.1-201 + * PLACE: expressions, when-expression -> paragraph 6 -> sentence 12 + * NUMBER: 1 + * DESCRIPTION: 'When' without bound value and with 'else' branch not in the last position. + */ + +// TESTCASE NUMBER: 1 +fun case_1(value_1: Int): String = when { + else -> "" + value_1 == 1 -> "" +} + +// TESTCASE NUMBER: 2 +fun case_2(value_1: Int): String = when { + value_1 == 1 -> "" + else -> "" + value_1 == 2 -> "" +} + +// TESTCASE NUMBER: 3 +fun case_3(): String { + when { + else -> return "" + else -> return "" + } + + return "" +} diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/6.1.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/7.1.kt similarity index 96% rename from compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/6.1.kt rename to compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/7.1.kt index 43d9d108b62..6d9c647f876 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/6.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/7.1.kt @@ -4,8 +4,8 @@ /* * KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE) * - * SPEC VERSION: 0.1-100 - * PLACE: expressions, when-expression -> paragraph 6 -> sentence 6 + * SPEC VERSION: 0.1-201 + * PLACE: expressions, when-expression -> paragraph 6 -> sentence 7 * NUMBER: 1 * DESCRIPTION: 'When' with bound value and with else branch not in the last position. */ diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/9.1.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/9.1.kt deleted file mode 100644 index 60519fdb17b..00000000000 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/9.1.kt +++ /dev/null @@ -1,35 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VALUE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -// SKIP_TXT - -/* - * KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE) - * - * SPEC VERSION: 0.1-100 - * PLACE: expressions, when-expression -> paragraph 6 -> sentence 9 - * 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): String { - when (value_1) { - while (false) {} -> return "" - do {} while (false) -> return "" - 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) { - value_2 = 10 -> return "" - value_3 %= 10 -> return "" - } - - return "" -} \ No newline at end of file diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/9.1.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/10.1.kt similarity index 99% rename from compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/9.1.kt rename to compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/10.1.kt index 8804f19ed6f..3023fdc76e7 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/9.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/10.1.kt @@ -3,8 +3,8 @@ /* * KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE) * - * SPEC VERSION: 0.1-100 - * PLACE: expressions, when-expression -> paragraph 6 -> sentence 9 + * SPEC VERSION: 0.1-201 + * PLACE: expressions, when-expression -> paragraph 6 -> sentence 10 * NUMBER: 1 * DESCRIPTION: 'When' with enumeration of the different variants of expressions in 'when condition'. * HELPERS: typesProvider, classes, functions diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/9.2.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/10.2.kt similarity index 99% rename from compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/9.2.kt rename to compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/10.2.kt index 7ee25e1801d..0f19893e2d2 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/9.2.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/10.2.kt @@ -3,8 +3,8 @@ /* * KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE) * - * SPEC VERSION: 0.1-100 - * PLACE: expressions, when-expression -> paragraph 6 -> sentence 9 + * SPEC VERSION: 0.1-201 + * PLACE: expressions, when-expression -> paragraph 6 -> sentence 10 * NUMBER: 2 * DESCRIPTION: 'When' with different variants of the arithmetic expressions (additive expression and multiplicative expression) in 'when condition'. * HELPERS: typesProvider, classes, functions diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/11.1.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/12.1.kt similarity index 94% rename from compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/11.1.kt rename to compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/12.1.kt index 8475aa9e457..4b0624b0f8f 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/11.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/12.1.kt @@ -3,8 +3,8 @@ /* * KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE) * - * SPEC VERSION: 0.1-100 - * PLACE: expressions, when-expression -> paragraph 6 -> sentence 11 + * SPEC VERSION: 0.1-201 + * PLACE: expressions, when-expression -> paragraph 6 -> sentence 12 * NUMBER: 1 * DESCRIPTION: 'When' without bound value and with else branch in the last position. */ diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/6.1.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/7.1.kt similarity index 95% rename from compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/6.1.kt rename to compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/7.1.kt index f53d161965a..d7a64d4606e 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/6.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/7.1.kt @@ -1,8 +1,8 @@ /* * KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE) * - * SPEC VERSION: 0.1-100 - * PLACE: expressions, when-expression -> paragraph 6 -> sentence 6 + * SPEC VERSION: 0.1-201 + * PLACE: expressions, when-expression -> paragraph 6 -> sentence 7 * NUMBER: 1 * DESCRIPTION: 'When' with bound value and else branch. */ diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/7.1.txt b/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/7.1.txt new file mode 100644 index 00000000000..3e32b1afbe6 --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/7.1.txt @@ -0,0 +1,5 @@ +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 diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/testsMap.json b/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/testsMap.json index 5b5065aacaf..5b4f871b8c7 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/testsMap.json +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/testsMap.json @@ -1,6 +1,42 @@ { "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.", + "unexpectedBehaviour": false + } + ], + "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.", + "unexpectedBehaviour": false + }, + { + "specVersion": "0.1-201", + "casesNumber": 2, + "description": "\u0027When\u0027 with bound value and non-expressions in \u0027when condition\u0027.", + "unexpectedBehaviour": false + }, + { + "specVersion": "0.1-155", + "casesNumber": 0, + "description": "When", + "path": "compiler/testData/diagnostics/tests/when/When.kt", + "unexpectedBehaviour": false + }, + { + "specVersion": "0.1-155", + "casesNumber": 0, + "description": "Redundant else", + "path": "compiler/testData/diagnostics/tests/when/RedundantElse.kt", + "unexpectedBehaviour": false + } + ], "1": [ { "specVersion": "0.1-100", @@ -85,57 +121,14 @@ "unexpectedBehaviour": false } ], - "9": [ + "7": [ { - "specVersion": "0.1-100", - "casesNumber": 2, - "description": "\u0027When\u0027 with bound value and non-expressions in \u0027when condition\u0027.", - "unexpectedBehaviour": false - }, - { - "specVersion": "0.1-100", - "casesNumber": 2, - "description": "\u0027When\u0027 with bound value and not allowed break and continue expression (without labels) in \u0027when condition\u0027.", - "unexpectedBehaviour": false - }, - { - "specVersion": "0.1-155", - "casesNumber": 0, - "description": "When", - "path": "compiler/testData/diagnostics/tests/when/When.kt", - "unexpectedBehaviour": false - } - ], - "6": [ - { - "specVersion": "0.1-100", + "specVersion": "0.1-201", "casesNumber": 3, "description": "\u0027When\u0027 with bound value and with else branch not in the last position.", "unexpectedBehaviour": false } ], - "11": [ - { - "specVersion": "0.1-100", - "casesNumber": 3, - "description": "\u0027When\u0027 without bound value and with \u0027else\u0027 branch not in the last position.", - "unexpectedBehaviour": false - }, - { - "specVersion": "0.1-155", - "casesNumber": 0, - "description": "When", - "path": "compiler/testData/diagnostics/tests/when/When.kt", - "unexpectedBehaviour": false - }, - { - "specVersion": "0.1-155", - "casesNumber": 0, - "description": "Redundant else", - "path": "compiler/testData/diagnostics/tests/when/RedundantElse.kt", - "unexpectedBehaviour": false - } - ], "5": [ { "specVersion": "0.1-155", @@ -166,6 +159,15 @@ "unexpectedBehaviour": false } ], + "9": [ + { + "specVersion": "0.1-155", + "casesNumber": 0, + "description": "When", + "path": "compiler/testData/diagnostics/tests/when/When.kt", + "unexpectedBehaviour": false + } + ], "10": [ { "specVersion": "0.1-155", @@ -184,6 +186,14 @@ ] }, "pos": { + "12": [ + { + "specVersion": "0.1-201", + "casesNumber": 2, + "description": "\u0027When\u0027 without bound value and with else branch in the last position.", + "unexpectedBehaviour": false + } + ], "1": [ { "specVersion": "0.1-100", @@ -231,6 +241,20 @@ "unexpectedBehaviour": false } ], + "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.", + "unexpectedBehaviour": true + }, + { + "specVersion": "0.1-201", + "casesNumber": 23, + "description": "\u0027When\u0027 with enumeration of the different variants of expressions in \u0027when condition\u0027.", + "unexpectedBehaviour": false + } + ], "3": [ { "specVersion": "0.1-100", @@ -245,36 +269,14 @@ "unexpectedBehaviour": false } ], - "9": [ + "7": [ { - "specVersion": "0.1-100", - "casesNumber": 23, - "description": "\u0027When\u0027 with enumeration of the different variants of expressions in \u0027when condition\u0027.", - "unexpectedBehaviour": false - }, - { - "specVersion": "0.1-100", - "casesNumber": 26, - "description": "\u0027When\u0027 with different variants of the arithmetic expressions (additive expression and multiplicative expression) in \u0027when condition\u0027.", - "unexpectedBehaviour": true - } - ], - "6": [ - { - "specVersion": "0.1-100", + "specVersion": "0.1-201", "casesNumber": 3, "description": "\u0027When\u0027 with bound value and else branch.", "unexpectedBehaviour": false } ], - "11": [ - { - "specVersion": "0.1-100", - "casesNumber": 2, - "description": "\u0027When\u0027 without bound value and with else branch in the last position.", - "unexpectedBehaviour": false - } - ], "5": [ { "specVersion": "0.1-155", diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/testsMap.json b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/testsMap.json index 4550cdc74e0..ad33f65b30d 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/testsMap.json +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/testsMap.json @@ -3,14 +3,14 @@ "neg": { "3": [ { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "When and lambda with expected type", "path": "compiler/testData/diagnostics/tests/when/whenAndLambdaWithExpectedType.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "No else returned from lambda expected int", "path": "compiler/testData/diagnostics/tests/when/NoElseReturnedFromLambdaExpectedInt.kt", @@ -21,7 +21,7 @@ "pos": { "1": [ { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Kt10439", "path": "compiler/testData/diagnostics/tests/when/kt10439.kt", @@ -34,7 +34,7 @@ "neg": { "3": [ { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "When with nothing and lambdas", "path": "compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.kt", diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/rationale/testsMap.json b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/rationale/testsMap.json index 598921b3b6b..059b9849e6b 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/rationale/testsMap.json +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/rationale/testsMap.json @@ -3,7 +3,7 @@ "pos": { "1": [ { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Kt10439", "path": "compiler/testData/diagnostics/tests/when/kt10439.kt", diff --git a/compiler/tests-spec/testData/diagnostics/linked/type-inference/local-type-inference/testsMap.json b/compiler/tests-spec/testData/diagnostics/linked/type-inference/local-type-inference/testsMap.json index e0fbaa5ed80..984c6bf9e55 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/type-inference/local-type-inference/testsMap.json +++ b/compiler/tests-spec/testData/diagnostics/linked/type-inference/local-type-inference/testsMap.json @@ -3,7 +3,7 @@ "neg": { "1": [ { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "When and lambda with expected type", "path": "compiler/testData/diagnostics/tests/when/whenAndLambdaWithExpectedType.kt", @@ -14,14 +14,14 @@ "pos": { "1": [ { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Kt10811", "path": "compiler/testData/diagnostics/tests/when/kt10811.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Kt10809", "path": "compiler/testData/diagnostics/tests/when/kt10809.kt", @@ -34,14 +34,14 @@ "pos": { "1": [ { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Kt10811", "path": "compiler/testData/diagnostics/tests/when/kt10811.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Kt10809", "path": "compiler/testData/diagnostics/tests/when/kt10809.kt", diff --git a/compiler/tests-spec/testData/diagnostics/linked/type-inference/smart-casts/smart-cast-types/testsMap.json b/compiler/tests-spec/testData/diagnostics/linked/type-inference/smart-casts/smart-cast-types/testsMap.json index 16c2f928309..e5882dd0e3e 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/type-inference/smart-casts/smart-cast-types/testsMap.json +++ b/compiler/tests-spec/testData/diagnostics/linked/type-inference/smart-casts/smart-cast-types/testsMap.json @@ -3,49 +3,49 @@ "pos": { "1": [ { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Branch false bypass", "path": "compiler/testData/diagnostics/tests/when/BranchFalseBypass.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive with nullability check before", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckBefore.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive with nullability check else", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckElse.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Branch false bypass else", "path": "compiler/testData/diagnostics/tests/when/BranchFalseBypassElse.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive with nullability check", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheck.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Exhaustive with nullability check boolean", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckBoolean.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Kt10809", "path": "compiler/testData/diagnostics/tests/when/kt10809.kt", @@ -54,14 +54,14 @@ ], "8": [ { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Branch false bypass", "path": "compiler/testData/diagnostics/tests/when/BranchFalseBypass.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Branch false bypass else", "path": "compiler/testData/diagnostics/tests/when/BranchFalseBypassElse.kt", @@ -72,35 +72,35 @@ "neg": { "1": [ { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "When type disjunctions", "path": "compiler/testData/diagnostics/tests/when/WhenTypeDisjunctions.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Branch bypass val", "path": "compiler/testData/diagnostics/tests/when/BranchBypassVal.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Non exhaustive warning for sealed class", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningForSealedClass.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Branch bypass var", "path": "compiler/testData/diagnostics/tests/when/BranchBypassVar.kt", "unexpectedBehaviour": false }, { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Non exhaustive with nullability check", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWithNullabilityCheck.kt", @@ -109,7 +109,7 @@ ], "6": [ { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Branch bypass val", "path": "compiler/testData/diagnostics/tests/when/BranchBypassVal.kt", @@ -118,7 +118,7 @@ ], "8": [ { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Branch bypass var", "path": "compiler/testData/diagnostics/tests/when/BranchBypassVar.kt", diff --git a/compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-8/pos/1.1.kt b/compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-8/pos/1.1.kt index 40aa9af89e8..e7697dad5a8 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-8/pos/1.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-8/pos/1.1.kt @@ -5,7 +5,7 @@ /* * KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE) * - * SPEC VERSION: 0.1-100 + * SPEC VERSION: 0.1-201 * 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 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 index 5095388485b..d61970d06b6 100644 --- 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 @@ -55,7 +55,7 @@ ], "1": [ { - "specVersion": "0.1-100", + "specVersion": "0.1-201", "casesNumber": 13, "description": "The use of Boolean literals as the identifier (with backtick) in the class.", "unexpectedBehaviour": false @@ -67,7 +67,7 @@ "pos": { "2": [ { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Kt9929", "path": "compiler/testData/diagnostics/tests/when/kt9929.kt", diff --git a/compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-for-nullable-types/testsMap.json b/compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-for-nullable-types/testsMap.json index 0495e7a37b0..075b756d3ee 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-for-nullable-types/testsMap.json +++ b/compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-for-nullable-types/testsMap.json @@ -3,7 +3,7 @@ "pos": { "1": [ { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Kt10811", "path": "compiler/testData/diagnostics/tests/when/kt10811.kt", @@ -12,7 +12,7 @@ ], "2": [ { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Kt10811", "path": "compiler/testData/diagnostics/tests/when/kt10811.kt", diff --git a/compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-rules/testsMap.json b/compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-rules/testsMap.json index cf85cc8d057..c5eb6d7403f 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-rules/testsMap.json +++ b/compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-rules/testsMap.json @@ -3,7 +3,7 @@ "neg": { "1": [ { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "When and lambda with expected type", "path": "compiler/testData/diagnostics/tests/when/whenAndLambdaWithExpectedType.kt", @@ -14,7 +14,7 @@ "pos": { "3": [ { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Kt10811", "path": "compiler/testData/diagnostics/tests/when/kt10811.kt", 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 index 3dd90f9fe4e..44e7489870d 100644 --- 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 @@ -3,7 +3,7 @@ "pos": { "1": [ { - "specVersion": "0.1-100", + "specVersion": "0.1-201", "casesNumber": 13, "description": "The use of Boolean literals as the identifier (with backtick) in the class.", "path": "compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-8/pos/1.1.kt", diff --git a/compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/type-parameters/testsMap.json b/compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/type-parameters/testsMap.json index 503b2b23d53..dacfa21c791 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/type-parameters/testsMap.json +++ b/compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/type-parameters/testsMap.json @@ -3,7 +3,7 @@ "pos": { "1": [ { - "specVersion": "0.1-155", + "specVersion": "0.1-152", "casesNumber": 0, "description": "Kt10809", "path": "compiler/testData/diagnostics/tests/when/kt10809.kt", diff --git a/compiler/tests-spec/testData/psi/linked/expressions/when-expression/p-6/neg/11.1.kt b/compiler/tests-spec/testData/psi/linked/expressions/when-expression/p-6/neg/12.1.kt similarity index 93% rename from compiler/tests-spec/testData/psi/linked/expressions/when-expression/p-6/neg/11.1.kt rename to compiler/tests-spec/testData/psi/linked/expressions/when-expression/p-6/neg/12.1.kt index c6210ad510a..2ed37e3b0e4 100644 --- a/compiler/tests-spec/testData/psi/linked/expressions/when-expression/p-6/neg/11.1.kt +++ b/compiler/tests-spec/testData/psi/linked/expressions/when-expression/p-6/neg/12.1.kt @@ -1,8 +1,8 @@ /* * KOTLIN PSI SPEC TEST (NEGATIVE) * - * SPEC VERSION: 0.1-100 - * PLACE: expressions, when-expression -> paragraph 6 -> sentence 11 + * SPEC VERSION: 0.1-201 + * PLACE: expressions, when-expression -> paragraph 6 -> sentence 12 * NUMBER: 1 * DESCRIPTION: 'When' with invalid else condition. */ diff --git a/compiler/tests-spec/testData/psi/linked/expressions/when-expression/p-6/neg/12.1.txt b/compiler/tests-spec/testData/psi/linked/expressions/when-expression/p-6/neg/12.1.txt new file mode 100644 index 00000000000..c56076d4fbc --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/expressions/when-expression/p-6/neg/12.1.txt @@ -0,0 +1,160 @@ +KtFile: 12.1.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('case_1') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + WHEN + PsiElement(when)('when') + PsiWhiteSpace(' ') + PsiElement(LPAR)('(') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('value') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + WHEN_ENTRY + PsiElement(else)('else') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiErrorElement:Expecting an element + + PsiWhiteSpace('\n ') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + WHEN + PsiElement(when)('when') + PsiWhiteSpace(' ') + PsiElement(LPAR)('(') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('value') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + WHEN_ENTRY + PsiElement(else)('else') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiErrorElement:Expecting an element + + PsiWhiteSpace('\n ') + WHEN_ENTRY + PsiElement(else)('else') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiErrorElement:Expecting an element + + PsiWhiteSpace('\n ') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + WHEN + PsiElement(when)('when') + PsiWhiteSpace(' ') + PsiElement(LPAR)('(') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('value') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + WHEN_ENTRY + WHEN_CONDITION_WITH_EXPRESSION + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('println') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + LITERAL_STRING_TEMPLATE_ENTRY + PsiElement(REGULAR_STRING_PART)('1') + PsiElement(CLOSING_QUOTE)('"') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + WHEN_ENTRY + WHEN_CONDITION_WITH_EXPRESSION + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('2') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('println') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + LITERAL_STRING_TEMPLATE_ENTRY + PsiElement(REGULAR_STRING_PART)('2') + PsiElement(CLOSING_QUOTE)('"') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + WHEN_ENTRY + PsiElement(else)('else') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiErrorElement:Expecting an element + + PsiWhiteSpace('\n ') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + WHEN + PsiElement(when)('when') + PsiWhiteSpace(' ') + PsiElement(LPAR)('(') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('value') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + WHEN_ENTRY + WHEN_CONDITION_WITH_EXPRESSION + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('println') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + LITERAL_STRING_TEMPLATE_ENTRY + PsiElement(REGULAR_STRING_PART)('!') + PsiElement(CLOSING_QUOTE)('"') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + WHEN_ENTRY + PsiElement(else)('else') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiErrorElement:Expecting an element + + PsiWhiteSpace('\n ') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/expressions/when-expression/p-6/neg/8.1.kt b/compiler/tests-spec/testData/psi/linked/expressions/when-expression/p-6/neg/9.1.kt similarity index 92% rename from compiler/tests-spec/testData/psi/linked/expressions/when-expression/p-6/neg/8.1.kt rename to compiler/tests-spec/testData/psi/linked/expressions/when-expression/p-6/neg/9.1.kt index 253855d3e51..5399213d12a 100644 --- a/compiler/tests-spec/testData/psi/linked/expressions/when-expression/p-6/neg/8.1.kt +++ b/compiler/tests-spec/testData/psi/linked/expressions/when-expression/p-6/neg/9.1.kt @@ -1,8 +1,8 @@ /* * KOTLIN PSI SPEC TEST (NEGATIVE) * - * SPEC VERSION: 0.1-100 - * PLACE: expressions, when-expression -> paragraph 6 -> sentence 8 + * SPEC VERSION: 0.1-201 + * PLACE: expressions, when-expression -> paragraph 6 -> sentence 9 * NUMBER: 1 * DESCRIPTION: 'When' with bound value and not allowed spread operator in 'when condition'. */ diff --git a/compiler/tests-spec/testData/psi/linked/expressions/when-expression/p-6/neg/9.1.txt b/compiler/tests-spec/testData/psi/linked/expressions/when-expression/p-6/neg/9.1.txt new file mode 100644 index 00000000000..14927472c2c --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/expressions/when-expression/p-6/neg/9.1.txt @@ -0,0 +1,138 @@ +KtFile: 9.1.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('case_1') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + WHEN + PsiElement(when)('when') + PsiWhiteSpace(' ') + PsiElement(LPAR)('(') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('value') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + WHEN_ENTRY + WHEN_CONDITION_WITH_EXPRESSION + PsiErrorElement:Expecting an expression + + PsiErrorElement:Expecting '->' + PsiElement(MUL)('*') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('value') + PsiWhiteSpace(' ') + WHEN_ENTRY + WHEN_CONDITION_WITH_EXPRESSION + PsiErrorElement:Expecting an expression, is-condition or in-condition + + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + RETURN + PsiElement(return)('return') + PsiWhiteSpace(' ') + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + PsiElement(CLOSING_QUOTE)('"') + PsiWhiteSpace('\n ') + WHEN_ENTRY + WHEN_CONDITION_WITH_EXPRESSION + PsiErrorElement:Expecting an expression + + PsiErrorElement:Expecting '->' + PsiElement(MUL)('*') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('arrayOf') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + LITERAL_STRING_TEMPLATE_ENTRY + PsiElement(REGULAR_STRING_PART)('a') + PsiElement(CLOSING_QUOTE)('"') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + LITERAL_STRING_TEMPLATE_ENTRY + PsiElement(REGULAR_STRING_PART)('b') + PsiElement(CLOSING_QUOTE)('"') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + LITERAL_STRING_TEMPLATE_ENTRY + PsiElement(REGULAR_STRING_PART)('c') + PsiElement(CLOSING_QUOTE)('"') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + WHEN_ENTRY + WHEN_CONDITION_WITH_EXPRESSION + PsiErrorElement:Expecting an expression, is-condition or in-condition + + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + RETURN + PsiElement(return)('return') + PsiWhiteSpace(' ') + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + PsiElement(CLOSING_QUOTE)('"') + PsiWhiteSpace('\n ') + WHEN_ENTRY + WHEN_CONDITION_WITH_EXPRESSION + PsiErrorElement:Expecting an expression + + PsiErrorElement:Expecting '->' + PsiElement(MUL)('*') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('listOf') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + NULL + PsiElement(null)('null') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + NULL + PsiElement(null)('null') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + NULL + PsiElement(null)('null') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + WHEN_ENTRY + WHEN_CONDITION_WITH_EXPRESSION + PsiErrorElement:Expecting an expression, is-condition or in-condition + + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + RETURN + PsiElement(return)('return') + PsiWhiteSpace(' ') + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + PsiElement(CLOSING_QUOTE)('"') + PsiWhiteSpace('\n ') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/expressions/when-expression/testsMap.json b/compiler/tests-spec/testData/psi/linked/expressions/when-expression/testsMap.json index 9b270149238..03f35380171 100644 --- a/compiler/tests-spec/testData/psi/linked/expressions/when-expression/testsMap.json +++ b/compiler/tests-spec/testData/psi/linked/expressions/when-expression/testsMap.json @@ -1,6 +1,14 @@ { "6": { "neg": { + "12": [ + { + "specVersion": "0.1-201", + "casesNumber": 0, + "description": "\u0027When\u0027 with invalid else condition.", + "unexpectedBehaviour": false + } + ], "1": [ { "specVersion": "0.1-100", @@ -23,21 +31,13 @@ "unexpectedBehaviour": false } ], - "8": [ + "9": [ { - "specVersion": "0.1-100", + "specVersion": "0.1-201", "casesNumber": 0, "description": "\u0027When\u0027 with bound value and not allowed spread operator in \u0027when condition\u0027.", "unexpectedBehaviour": false } - ], - "11": [ - { - "specVersion": "0.1-100", - "casesNumber": 0, - "description": "\u0027When\u0027 with invalid else condition.", - "unexpectedBehaviour": false - } ] } }, 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 822dd5227b0..d028eecbe5c 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 @@ -3185,6 +3185,16 @@ public class DiagnosticsTestSpecGenerated extends AbstractDiagnosticsTestSpec { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/11.1.kt"); } + @TestMetadata("11.2.kt") + public void test11_2() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/11.2.kt"); + } + + @TestMetadata("12.1.kt") + public void test12_1() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/12.1.kt"); + } + @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/1.1.kt"); @@ -3205,19 +3215,9 @@ public class DiagnosticsTestSpecGenerated extends AbstractDiagnosticsTestSpec { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/3.2.kt"); } - @TestMetadata("6.1.kt") - public void test6_1() throws Exception { - runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/6.1.kt"); - } - - @TestMetadata("9.1.kt") - public void test9_1() throws Exception { - runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/9.1.kt"); - } - - @TestMetadata("9.2.kt") - public void test9_2() throws Exception { - runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/9.2.kt"); + @TestMetadata("7.1.kt") + public void test7_1() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/7.1.kt"); } public void testAllFilesPresentInNeg() throws Exception { @@ -3233,9 +3233,19 @@ public class DiagnosticsTestSpecGenerated extends AbstractDiagnosticsTestSpec { KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); } - @TestMetadata("11.1.kt") - public void test11_1() throws Exception { - runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/11.1.kt"); + @TestMetadata("10.1.kt") + public void test10_1() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/10.1.kt"); + } + + @TestMetadata("10.2.kt") + public void test10_2() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/10.2.kt"); + } + + @TestMetadata("12.1.kt") + public void test12_1() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/12.1.kt"); } @TestMetadata("1.1.kt") @@ -3268,19 +3278,9 @@ public class DiagnosticsTestSpecGenerated extends AbstractDiagnosticsTestSpec { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/3.2.kt"); } - @TestMetadata("6.1.kt") - public void test6_1() throws Exception { - runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/6.1.kt"); - } - - @TestMetadata("9.1.kt") - public void test9_1() throws Exception { - runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/9.1.kt"); - } - - @TestMetadata("9.2.kt") - public void test9_2() throws Exception { - runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/9.2.kt"); + @TestMetadata("7.1.kt") + public void test7_1() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/7.1.kt"); } public void testAllFilesPresentInPos() throws Exception { diff --git a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/consistency/SpecTestsConsistencyTest.kt b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/consistency/SpecTestsConsistencyTest.kt index 4646b2ab60f..a2593d19d94 100644 --- a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/consistency/SpecTestsConsistencyTest.kt +++ b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/consistency/SpecTestsConsistencyTest.kt @@ -65,7 +65,7 @@ class SpecTestsConsistencyTest : TestCase() { val paragraphForTestSentences = specSentencesForCurrentTest[sectionsPath] ?: throw Exception("$sectionsPath not found") if (paragraphForTestSentences.size < sentenceNumber) { - throw Exception("$sentenceNumber not found") + fail("Sentence #$sentenceNumber not found (${file.path})") } val expectedSentence = paragraphForTestSentences[sentenceNumber - 1] val actualSentence = paragraphSentences[sentenceNumber - 1] diff --git a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/parsing/AbstractParsingTestSpec.kt b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/parsing/AbstractParsingTestSpec.kt index a47cf438e7d..35ad1530ef3 100644 --- a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/parsing/AbstractParsingTestSpec.kt +++ b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/parsing/AbstractParsingTestSpec.kt @@ -18,7 +18,7 @@ abstract class AbstractParsingTestSpec : AbstractParsingTest() { override fun doParsingTest(filePath: String) { val file = File(filePath) val (specTest, testLinkedType) = CommonParser.parseSpecTest( - filePath, + file.canonicalPath, mapOf("main.kt" to FileUtil.loadFile(file, true)) ) diff --git a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/parsing/ParsingTestSpecGenerated.java b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/parsing/ParsingTestSpecGenerated.java index f3458c1140b..a889b6a6dbf 100644 --- a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/parsing/ParsingTestSpecGenerated.java +++ b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/parsing/ParsingTestSpecGenerated.java @@ -1150,9 +1150,9 @@ public class ParsingTestSpecGenerated extends AbstractParsingTestSpec { KotlinTestUtils.runTest(this::doParsingTest, this, testDataFilePath); } - @TestMetadata("11.1.kt") - public void test11_1() throws Exception { - runTest("compiler/tests-spec/testData/psi/linked/expressions/when-expression/p-6/neg/11.1.kt"); + @TestMetadata("12.1.kt") + public void test12_1() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/expressions/when-expression/p-6/neg/12.1.kt"); } @TestMetadata("1.1.kt") @@ -1170,9 +1170,9 @@ public class ParsingTestSpecGenerated extends AbstractParsingTestSpec { runTest("compiler/tests-spec/testData/psi/linked/expressions/when-expression/p-6/neg/3.1.kt"); } - @TestMetadata("8.1.kt") - public void test8_1() throws Exception { - runTest("compiler/tests-spec/testData/psi/linked/expressions/when-expression/p-6/neg/8.1.kt"); + @TestMetadata("9.1.kt") + public void test9_1() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/expressions/when-expression/p-6/neg/9.1.kt"); } public void testAllFilesPresentInNeg() throws Exception { diff --git a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/TestsJsonMapGenerator.kt b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/TestsJsonMapGenerator.kt index 3c68841ff92..869c3e1f40e 100644 --- a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/TestsJsonMapGenerator.kt +++ b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/TestsJsonMapGenerator.kt @@ -13,6 +13,7 @@ import org.jetbrains.kotlin.spec.utils.models.LinkedSpecTest import org.jetbrains.kotlin.spec.utils.models.LinkedSpecTest.Companion.getInstanceForImplementationTest import org.jetbrains.kotlin.spec.utils.models.SpecPlace import org.jetbrains.kotlin.spec.utils.parsers.CommonParser +import org.jetbrains.kotlin.spec.utils.parsers.CommonParser.parseImplementationTest import org.jetbrains.kotlin.spec.utils.parsers.ImplementationTestPatterns import java.io.File @@ -20,8 +21,6 @@ object TestsJsonMapGenerator { private const val LINKED_TESTS_PATH = "linked" const val TESTS_MAP_FILENAME = "testsMap.json" - private val testsMap = JsonObject() - private inline fun JsonObject.getOrCreate(key: String): T { if (!has(key)) { add(key, T::class.java.newInstance()) @@ -50,7 +49,9 @@ object TestsJsonMapGenerator { ) } - private fun collectInfoFromSpecTests() { + private fun collectInfoFromSpecTests(): JsonObject { + val testsMap = JsonObject() + TestArea.values().forEach { testArea -> File("${GeneralConfiguration.SPEC_TESTDATA_PATH}/${testArea.testDataPath}/$LINKED_TESTS_PATH").walkTopDown() .forEach testFiles@{ file -> @@ -70,50 +71,41 @@ object TestsJsonMapGenerator { } } } + + return testsMap } - private fun collectInfoFromImplementationTests() { + private fun collectInfoFromImplementationTests(): JsonObject { + val testsMap = JsonObject() + TestArea.values().forEach { testArea -> - File("${GeneralConfiguration.TESTDATA_PATH}/${testArea.testDataPath}").walkTopDown() - .forEach testFiles@{ file -> - if (!file.isFile || file.extension != "kt") return@testFiles + val files = File("${GeneralConfiguration.TESTDATA_PATH}/${testArea.testDataPath}").walkTopDown() - val matcher = ImplementationTestPatterns.testInfoPattern.matcher(file.readText()) + for (file in files) { + if (!file.isFile || file.extension != "kt") continue - if (!matcher.find()) return@testFiles + val parserImplementationTest = parseImplementationTest(file, testArea) + val relevantPlaces = parserImplementationTest.relevantPlaces ?: listOf() - val specVersion = matcher.group("specVersion") - val testType = TestType.fromValue(matcher.group("testType"))!! - val testSpecSentenceList = matcher.group("testSpecSentenceList") - val specSentenceListMatcher = ImplementationTestPatterns.relevantSpecSentencesPattern.matcher(testSpecSentenceList) - val specPlaces = mutableSetOf() - - while (specSentenceListMatcher.find()) { - specPlaces.add( - SpecPlace( - sections = specSentenceListMatcher.group("specSections").split(Regex(""",\s*""")), - paragraphNumber = specSentenceListMatcher.group("specParagraph").toInt(), - sentenceNumber = specSentenceListMatcher.group("specSentence").toInt() - ) - ) - } - - specPlaces.forEach { specPlace -> - testsMap.getOrCreateSpecTestObject(specPlace, testArea, testType).add( - getTestInfo( - getInstanceForImplementationTest(specVersion, testArea, testType, specPlace, file.nameWithoutExtension), - file - ) - ) - } + (relevantPlaces + parserImplementationTest.place).forEach { specPlace -> + testsMap.getOrCreateSpecTestObject(specPlace, testArea, parserImplementationTest.testType).add( + getTestInfo(parseImplementationTest(file, testArea), file) + ) } + } } + + return testsMap } + operator fun JsonObject.plus(other: JsonObject) = + JsonObject().also { new -> + this.keySet().forEach { new.add(it, this.get(it)) } + other.keySet().forEach { new.add(it, other.get(it)) } + } + fun buildTestsMapPerSection() { - collectInfoFromSpecTests() - collectInfoFromImplementationTests() - + val testsMap = collectInfoFromSpecTests() + collectInfoFromImplementationTests() val gson = GsonBuilder().setPrettyPrinting().create() testsMap.keySet().forEach { testPath -> diff --git a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/models/LinkedSpecTest.kt b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/models/LinkedSpecTest.kt index caed1867405..d1375cc3833 100644 --- a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/models/LinkedSpecTest.kt +++ b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/models/LinkedSpecTest.kt @@ -55,15 +55,15 @@ class LinkedSpecTest( specVersion: String, testArea: TestArea, testType: TestType, - specPlace: SpecPlace, + specPlaces: List, filename: String ): LinkedSpecTest { val description = filename[0].toUpperCase() + filename.substring(1).replace(Regex("""([A-Z])"""), " $1").toLowerCase() return LinkedSpecTest( - specVersion, testArea, testType, specPlace, - null, 0, description, + specVersion, testArea, testType, specPlaces.first(), + specPlaces.subList(1, specPlaces.size - 1), 0, description, SpecTestCasesSet(mutableMapOf(), mutableMapOf(), mutableMapOf()), unexpectedBehavior = false, unspecifiedBehavior = false, issues = setOf(), helpers = null, exception = null ) diff --git a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/parsers/CommonParser.kt b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/parsers/CommonParser.kt index 6606329c2e4..378084a3854 100644 --- a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/parsers/CommonParser.kt +++ b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/parsers/CommonParser.kt @@ -5,10 +5,7 @@ package org.jetbrains.kotlin.spec.utils.parsers -import org.jetbrains.kotlin.spec.utils.SpecTestInfoElementContent -import org.jetbrains.kotlin.spec.utils.SpecTestInfoElementType -import org.jetbrains.kotlin.spec.utils.SpecTestLinkedType -import org.jetbrains.kotlin.spec.utils.TestFiles +import org.jetbrains.kotlin.spec.utils.* import org.jetbrains.kotlin.spec.utils.models.* import org.jetbrains.kotlin.spec.utils.parsers.CommonPatterns.testInfoElementPattern import org.jetbrains.kotlin.spec.utils.parsers.CommonPatterns.testPathBaseRegexTemplate @@ -47,6 +44,32 @@ object CommonParser { throw SpecTestValidationException(SpecTestValidationFailedReason.FILENAME_NOT_VALID) } + fun parseImplementationTest(file: File, testArea: TestArea): LinkedSpecTest { + val matcher = ImplementationTestPatterns.testInfoPattern.matcher(file.readText()) + + if (!matcher.find()) + throw SpecTestValidationException(SpecTestValidationFailedReason.TESTINFO_NOT_VALID) + + val testType = TestType.fromValue(matcher.group("testType")) + ?: throw SpecTestValidationException(SpecTestValidationFailedReason.TESTINFO_NOT_VALID) + val specVersion = matcher.group("specVersion") + val testSpecSentenceList = matcher.group("testSpecSentenceList") + val specSentenceListMatcher = ImplementationTestPatterns.relevantSpecSentencesPattern.matcher(testSpecSentenceList) + val specPlaces = mutableListOf() + + while (specSentenceListMatcher.find()) { + specPlaces.add( + SpecPlace( + sections = specSentenceListMatcher.group("specSections").split(Regex(""",\s*""")), + paragraphNumber = specSentenceListMatcher.group("specParagraph").toInt(), + sentenceNumber = specSentenceListMatcher.group("specSentence").toInt() + ) + ) + } + + return LinkedSpecTest.getInstanceForImplementationTest(specVersion, testArea, testType, specPlaces, file.nameWithoutExtension) + } + private fun createSpecPlace(placeMatcher: Matcher, basePlaceMatcher: Matcher = placeMatcher) = SpecPlace( placeMatcher.group("sections")?.splitByComma() ?: basePlaceMatcher.group("sections").splitByComma(),