From 270972ca1c96d9d6f8a7549e9a301a27530f7dd4 Mon Sep 17 00:00:00 2001 From: "anastasiia.spaseeva" Date: Thu, 16 Apr 2020 13:43:31 +0300 Subject: [PATCH] [Spec tests] Make main link nullable for case if implementation tests don't have this one --- .../annotation-targets/testsMap.json | 2 +- .../conditional-expressions/testsMap.json | 12 +- .../testsMap.json | 52 ++-- .../classifier-initialization/testsMap.json | 2 +- .../function-declaration/testsMap.json | 8 +- .../callable-references/testsMap.json | 4 +- .../navigation-operators/testsMap.json | 4 +- .../conditional-expression/testsMap.json | 12 +- .../lambda-literals/testsMap.json | 4 +- .../exhaustive-when-expressions/testsMap.json | 176 +++++++------- .../expressions/when-expression/testsMap.json | 224 +++++++++--------- .../description/testsMap.json | 8 +- .../rationale/testsMap.json | 2 +- .../local-type-inference/testsMap.json | 10 +- .../smart-cast-types/testsMap.json | 32 +-- .../testsMap.json | 4 +- .../subtyping/subtyping-rules/testsMap.json | 4 +- .../type-kinds/type-parameters/testsMap.json | 2 +- .../consistency/SpecTestsConsistencyTest.kt | 7 +- .../spec/utils/TestsJsonMapGenerator.kt | 74 +++--- .../spec/utils/models/LinkedSpecTest.kt | 38 ++- .../kotlin/spec/utils/parsers/CommonParser.kt | 62 ++--- .../kotlin/spec/utils/parsers/Patterns.kt | 6 +- 23 files changed, 379 insertions(+), 370 deletions(-) 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 9653a5338c0..337b5fe8fc0 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 @@ -8,7 +8,7 @@ "description": "Annotated when statement", "path": "compiler/testData/diagnostics/tests/when/AnnotatedWhenStatement.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] } diff --git a/compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/testsMap.json b/compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/testsMap.json index 213e6a9e58c..d32c6e3fe00 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/testsMap.json +++ b/compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/testsMap.json @@ -80,7 +80,7 @@ "description": "Exhaustive with nullability check before", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckBefore.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -88,7 +88,7 @@ "description": "Exhaustive with nullability check else", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckElse.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] } @@ -102,7 +102,7 @@ "description": "When type disjunctions", "path": "compiler/testData/diagnostics/tests/when/WhenTypeDisjunctions.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -110,7 +110,7 @@ "description": "Exhaustive break continue", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveBreakContinue.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] }, @@ -122,7 +122,7 @@ "description": "Exhaustive return throw", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveReturnThrow.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -130,7 +130,7 @@ "description": "Exhaustive return", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveReturn.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] } 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 b66be22015d..cd143bba3e2 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 @@ -8,7 +8,7 @@ "description": "Non exhaustive warning null", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningNull.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -16,7 +16,7 @@ "description": "Non exhaustive warning", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarning.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -24,7 +24,7 @@ "description": "Exhaustive val over conditional init", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveValOverConditionalInit.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -32,7 +32,7 @@ "description": "Non exhaustive warning false", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningFalse.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -40,7 +40,7 @@ "description": "Exhaustive var over conditional init", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveVarOverConditionalInit.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -48,7 +48,7 @@ "description": "Property not initialized", "path": "compiler/testData/diagnostics/tests/when/PropertyNotInitialized.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -56,7 +56,7 @@ "description": "Non exhaustive warning else", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningElse.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ], "3": [ @@ -66,7 +66,7 @@ "description": "Non exhaustive warning null", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningNull.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -74,7 +74,7 @@ "description": "Non exhaustive warning", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarning.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -82,7 +82,7 @@ "description": "Exhaustive val over conditional init", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveValOverConditionalInit.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -90,7 +90,7 @@ "description": "Non exhaustive warning false", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningFalse.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -98,7 +98,7 @@ "description": "Exhaustive var over conditional init", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveVarOverConditionalInit.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -106,7 +106,7 @@ "description": "Property not initialized", "path": "compiler/testData/diagnostics/tests/when/PropertyNotInitialized.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -114,7 +114,7 @@ "description": "Non exhaustive warning else", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningElse.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] }, @@ -126,7 +126,7 @@ "description": "Exhaustive nullable", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveNullable.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -134,7 +134,7 @@ "description": "Exhaustive initialization", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveInitialization.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -142,7 +142,7 @@ "description": "Exhaustive no initialization", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveNoInitialization.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ], "3": [ @@ -152,7 +152,7 @@ "description": "Exhaustive nullable", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveNullable.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -160,7 +160,7 @@ "description": "Exhaustive initialization", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveInitialization.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -168,7 +168,7 @@ "description": "Exhaustive no initialization", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveNoInitialization.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] } @@ -182,7 +182,7 @@ "description": "Exhaustive val over conditional init", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveValOverConditionalInit.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -190,7 +190,7 @@ "description": "Non exhaustive warning false", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningFalse.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -198,7 +198,7 @@ "description": "Exhaustive var over conditional init", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveVarOverConditionalInit.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -206,7 +206,7 @@ "description": "Property not initialized", "path": "compiler/testData/diagnostics/tests/when/PropertyNotInitialized.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -214,7 +214,7 @@ "description": "Non exhaustive warning else", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningElse.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ], "3": [ @@ -224,7 +224,7 @@ "description": "Exhaustive val over conditional init", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveValOverConditionalInit.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] } 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 d29ba260caf..25565ca2861 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 @@ -8,7 +8,7 @@ "description": "Property not initialized", "path": "compiler/testData/diagnostics/tests/when/PropertyNotInitialized.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] } 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 4231c7b08cf..07a10753e03 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 @@ -8,7 +8,7 @@ "description": "Kt10809", "path": "compiler/testData/diagnostics/tests/when/kt10809.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] }, @@ -20,7 +20,7 @@ "description": "When with nothing and lambdas", "path": "compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ], "2": [ @@ -30,7 +30,7 @@ "description": "When with nothing and lambdas", "path": "compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] } @@ -44,7 +44,7 @@ "description": "When with nothing and lambdas", "path": "compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] } diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/call-and-property-access-expressions/callable-references/testsMap.json b/compiler/tests-spec/testData/diagnostics/linked/expressions/call-and-property-access-expressions/callable-references/testsMap.json index b3ec99a6af7..531dd76cd81 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/call-and-property-access-expressions/callable-references/testsMap.json +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/call-and-property-access-expressions/callable-references/testsMap.json @@ -8,7 +8,7 @@ "description": "Callable reference as last expression in block", "path": "compiler/testData/diagnostics/tests/callableReference/callableReferenceAsLastExpressionInBlock.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] } @@ -22,7 +22,7 @@ "description": "Bare type", "path": "compiler/testData/diagnostics/tests/callableReference/bareType.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] } diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/call-and-property-access-expressions/navigation-operators/testsMap.json b/compiler/tests-spec/testData/diagnostics/linked/expressions/call-and-property-access-expressions/navigation-operators/testsMap.json index 2d6d2878268..ea1564b0c69 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/call-and-property-access-expressions/navigation-operators/testsMap.json +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/call-and-property-access-expressions/navigation-operators/testsMap.json @@ -8,7 +8,7 @@ "description": "Correct info after array like call", "path": "compiler/testData/diagnostics/tests/callableReference/correctInfoAfterArrayLikeCall.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] } @@ -22,7 +22,7 @@ "description": "Correct info after array like call", "path": "compiler/testData/diagnostics/tests/callableReference/correctInfoAfterArrayLikeCall.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] } diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression/testsMap.json b/compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression/testsMap.json index 9be78203d34..14a62db634f 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression/testsMap.json +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression/testsMap.json @@ -34,7 +34,7 @@ "description": "Kt10811", "path": "compiler/testData/diagnostics/tests/when/kt10811.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -42,7 +42,7 @@ "description": "Kt9972", "path": "compiler/testData/diagnostics/tests/when/kt9972.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -50,7 +50,7 @@ "description": "Kt10809", "path": "compiler/testData/diagnostics/tests/when/kt10809.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -58,7 +58,7 @@ "description": "Kt10439", "path": "compiler/testData/diagnostics/tests/when/kt10439.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] } @@ -72,7 +72,7 @@ "description": "Kt9972", "path": "compiler/testData/diagnostics/tests/when/kt9972.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -80,7 +80,7 @@ "description": "Kt10439", "path": "compiler/testData/diagnostics/tests/when/kt10439.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] } 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 9f62d7b6c17..858d9e90d3f 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 @@ -8,7 +8,7 @@ "description": "No else returned coercion to unit", "path": "compiler/testData/diagnostics/tests/when/NoElseReturnedCoercionToUnit.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -16,7 +16,7 @@ "description": "No else returned from lambda expected int", "path": "compiler/testData/diagnostics/tests/when/NoElseReturnedFromLambdaExpectedInt.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] } 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 8452654c7f4..24d43cfb086 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 @@ -32,7 +32,7 @@ "description": "Exhaustive boolean nullable", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanNullable.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -40,7 +40,7 @@ "description": "Non exhaustive warning null", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningNull.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -48,7 +48,7 @@ "description": "Else on nullable enum", "path": "compiler/testData/diagnostics/tests/when/ElseOnNullableEnum.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -56,7 +56,7 @@ "description": "Else on nullable enum with smart cast", "path": "compiler/testData/diagnostics/tests/when/ElseOnNullableEnumWithSmartCast.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ], "1": [ @@ -82,7 +82,7 @@ "description": "When and lambda with expected type", "path": "compiler/testData/diagnostics/tests/when/whenAndLambdaWithExpectedType.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -90,7 +90,7 @@ "description": "When type disjunctions", "path": "compiler/testData/diagnostics/tests/when/WhenTypeDisjunctions.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -98,7 +98,7 @@ "description": "Reserved exhaustive when", "path": "compiler/testData/diagnostics/tests/when/ReservedExhaustiveWhen.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -106,7 +106,7 @@ "description": "Non exhaustive warning else", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningElse.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -114,7 +114,7 @@ "description": "When with nothing and lambdas", "path": "compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ], "3": [ @@ -132,7 +132,7 @@ "description": "Exhaustive boolean nullable", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanNullable.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -140,7 +140,7 @@ "description": "Exhaustive val over conditional init", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveValOverConditionalInit.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -148,7 +148,7 @@ "description": "Exhaustive boolean brackets", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanBrackets.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -156,7 +156,7 @@ "description": "Exhaustive boolean complex", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanComplex.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -164,7 +164,7 @@ "description": "Exhaustive boolean", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveBoolean.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -172,7 +172,7 @@ "description": "Exhaustive var over conditional init", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveVarOverConditionalInit.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -180,7 +180,7 @@ "description": "Redundant else", "path": "compiler/testData/diagnostics/tests/when/RedundantElse.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ], "6": [ @@ -198,7 +198,7 @@ "description": "Non exhaustive warning for sealed class", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningForSealedClass.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -206,7 +206,7 @@ "description": "Redundant else", "path": "compiler/testData/diagnostics/tests/when/RedundantElse.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -214,7 +214,7 @@ "description": "Top level sealed", "path": "compiler/testData/diagnostics/tests/when/TopLevelSealed.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ], "4": [ @@ -224,7 +224,7 @@ "description": "Exhaustive boolean nullable", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanNullable.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -232,7 +232,7 @@ "description": "Exhaustive boolean brackets", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanBrackets.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -240,7 +240,7 @@ "description": "Exhaustive boolean complex", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanComplex.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -248,7 +248,7 @@ "description": "Exhaustive boolean", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveBoolean.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ], "9": [ @@ -258,7 +258,7 @@ "description": "Non exhaustive warning null", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningNull.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -266,7 +266,7 @@ "description": "Non exhaustive warning", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarning.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -274,7 +274,7 @@ "description": "Non exhaustive warning false", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningFalse.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -282,7 +282,7 @@ "description": "Non exhaustive platform enum", "path": "compiler/testData/diagnostics/tests/when/NonExhaustivePlatformEnum.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -290,7 +290,7 @@ "description": "Exhaustive enum mixed", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveEnumMixed.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -298,7 +298,7 @@ "description": "Property not initialized", "path": "compiler/testData/diagnostics/tests/when/PropertyNotInitialized.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -306,7 +306,7 @@ "description": "Non exhaustive warning else", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningElse.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -314,7 +314,7 @@ "description": "Redundant else", "path": "compiler/testData/diagnostics/tests/when/RedundantElse.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -322,7 +322,7 @@ "description": "Non exhaustive with nullability check", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWithNullabilityCheck.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -330,7 +330,7 @@ "description": "Exhaustive enum is", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveEnumIs.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -338,7 +338,7 @@ "description": "Exhaustive break continue", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveBreakContinue.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -346,7 +346,7 @@ "description": "Else on nullable enum", "path": "compiler/testData/diagnostics/tests/when/ElseOnNullableEnum.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -354,7 +354,7 @@ "description": "Else on nullable enum with smart cast", "path": "compiler/testData/diagnostics/tests/when/ElseOnNullableEnumWithSmartCast.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ], "5": [ @@ -364,7 +364,7 @@ "description": "Exhaustive boolean brackets", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanBrackets.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -372,7 +372,7 @@ "description": "Exhaustive boolean complex", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanComplex.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -380,7 +380,7 @@ "description": "Exhaustive boolean", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveBoolean.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ], "7": [ @@ -390,7 +390,7 @@ "description": "Non exhaustive warning for sealed class", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningForSealedClass.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -398,7 +398,7 @@ "description": "Top level sealed", "path": "compiler/testData/diagnostics/tests/when/TopLevelSealed.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ], "8": [ @@ -408,7 +408,7 @@ "description": "Top level sealed", "path": "compiler/testData/diagnostics/tests/when/TopLevelSealed.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] }, @@ -444,7 +444,7 @@ "description": "Exhaustive nullable", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveNullable.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -452,7 +452,7 @@ "description": "Non exhaustive boolean nullable", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveBooleanNullable.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -460,7 +460,7 @@ "description": "Exhaustive platform enum null", "path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumNull.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ], "1": [ @@ -494,7 +494,7 @@ "description": "Exhaustive platform enum else", "path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumElse.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -502,7 +502,7 @@ "description": "Kt4434", "path": "compiler/testData/diagnostics/tests/when/kt4434.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -510,7 +510,7 @@ "description": "Kt10811", "path": "compiler/testData/diagnostics/tests/when/kt10811.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -518,7 +518,7 @@ "description": "Kt9972", "path": "compiler/testData/diagnostics/tests/when/kt9972.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -526,7 +526,7 @@ "description": "Branch false bypass else", "path": "compiler/testData/diagnostics/tests/when/BranchFalseBypassElse.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -534,7 +534,7 @@ "description": "Kt10809", "path": "compiler/testData/diagnostics/tests/when/kt10809.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ], "3": [ @@ -552,7 +552,7 @@ "description": "Exhaustive with nullability check boolean", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckBoolean.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -560,7 +560,7 @@ "description": "Non exhaustive boolean nullable", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveBooleanNullable.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -568,7 +568,7 @@ "description": "Exhaustive no initialization", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveNoInitialization.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ], "8": [ @@ -598,7 +598,7 @@ "description": "Exhaustive platform enum else", "path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumElse.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -606,7 +606,7 @@ "description": "Branch false bypass", "path": "compiler/testData/diagnostics/tests/when/BranchFalseBypass.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -614,7 +614,7 @@ "description": "Exhaustive with nullability check before", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckBefore.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -622,7 +622,7 @@ "description": "Exhaustive with nullability check else", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckElse.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -630,7 +630,7 @@ "description": "Exhaustive platform enum statement", "path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumStatement.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -638,7 +638,7 @@ "description": "Exhaustive platform enum", "path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnum.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -646,7 +646,7 @@ "description": "Exhaustive nullable", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveNullable.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -654,7 +654,7 @@ "description": "Exhaustive initialization", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveInitialization.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -662,7 +662,7 @@ "description": "Exhaustive with nullability check", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheck.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -670,7 +670,7 @@ "description": "Exhaustive platform enum annotated", "path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumAnnotated.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -678,7 +678,7 @@ "description": "Exhaustive return throw", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveReturnThrow.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -686,7 +686,7 @@ "description": "Exhaustive return", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveReturn.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -694,7 +694,7 @@ "description": "Exhaustive platform enum null", "path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumNull.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ], "923": [ @@ -704,7 +704,7 @@ "description": "Exhaustive platform enum statement", "path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumStatement.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ], "4": [ @@ -714,7 +714,7 @@ "description": "Exhaustive with nullability check boolean", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckBoolean.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -722,7 +722,7 @@ "description": "Exhaustive no initialization", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveNoInitialization.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ], "5": [ @@ -732,7 +732,7 @@ "description": "Exhaustive with nullability check boolean", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckBoolean.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -740,7 +740,7 @@ "description": "Exhaustive no initialization", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveNoInitialization.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] } @@ -754,7 +754,7 @@ "description": "Non exhaustive warning null", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningNull.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -762,7 +762,7 @@ "description": "No else returned unit", "path": "compiler/testData/diagnostics/tests/when/NoElseReturnedUnit.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -770,7 +770,7 @@ "description": "No else expected unit", "path": "compiler/testData/diagnostics/tests/when/NoElseExpectedUnit.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -778,7 +778,7 @@ "description": "Branch bypass val", "path": "compiler/testData/diagnostics/tests/when/BranchBypassVal.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -786,7 +786,7 @@ "description": "Non exhaustive warning", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarning.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -794,7 +794,7 @@ "description": "No else returned coercion to unit", "path": "compiler/testData/diagnostics/tests/when/NoElseReturnedCoercionToUnit.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -802,7 +802,7 @@ "description": "Non exhaustive warning for sealed class", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningForSealedClass.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -810,7 +810,7 @@ "description": "Branch bypass var", "path": "compiler/testData/diagnostics/tests/when/BranchBypassVar.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -818,7 +818,7 @@ "description": "Non exhaustive platform enum", "path": "compiler/testData/diagnostics/tests/when/NonExhaustivePlatformEnum.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -826,7 +826,7 @@ "description": "No else returned from lambda expected int", "path": "compiler/testData/diagnostics/tests/when/NoElseReturnedFromLambdaExpectedInt.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -834,7 +834,7 @@ "description": "Non exhaustive with nullability check", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWithNullabilityCheck.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -842,7 +842,7 @@ "description": "No else no expected type", "path": "compiler/testData/diagnostics/tests/when/NoElseNoExpectedType.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -850,7 +850,7 @@ "description": "No else returned non unit", "path": "compiler/testData/diagnostics/tests/when/NoElseReturnedNonUnit.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] }, @@ -862,7 +862,7 @@ "description": "Kt4434", "path": "compiler/testData/diagnostics/tests/when/kt4434.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -870,7 +870,7 @@ "description": "Non exhaustive boolean nullable", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveBooleanNullable.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] } @@ -884,7 +884,7 @@ "description": "Non exhaustive warning for sealed class", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningForSealedClass.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] } 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 0d642e1abf9..87fe3e87a14 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 @@ -34,7 +34,7 @@ "description": "When type disjunctions", "path": "compiler/testData/diagnostics/tests/when/WhenTypeDisjunctions.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -42,7 +42,7 @@ "description": "Branch bypass val", "path": "compiler/testData/diagnostics/tests/when/BranchBypassVal.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -50,7 +50,7 @@ "description": "When", "path": "compiler/testData/diagnostics/tests/when/When.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -58,7 +58,7 @@ "description": "Branch bypass var", "path": "compiler/testData/diagnostics/tests/when/BranchBypassVar.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -66,7 +66,7 @@ "description": "Exhaustive enum mixed", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveEnumMixed.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -74,7 +74,7 @@ "description": "Exhaustive enum is", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveEnumIs.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -82,7 +82,7 @@ "description": "Top level sealed", "path": "compiler/testData/diagnostics/tests/when/TopLevelSealed.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ], "3": [ @@ -108,7 +108,7 @@ "description": "When", "path": "compiler/testData/diagnostics/tests/when/When.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ], "7": [ @@ -136,7 +136,7 @@ "description": "When", "path": "compiler/testData/diagnostics/tests/when/When.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -144,7 +144,7 @@ "description": "Redundant else", "path": "compiler/testData/diagnostics/tests/when/RedundantElse.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ], "5": [ @@ -154,7 +154,7 @@ "description": "When", "path": "compiler/testData/diagnostics/tests/when/When.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -162,7 +162,7 @@ "description": "Empty condition with expression enum", "path": "compiler/testData/diagnostics/tests/when/EmptyConditionWithExpressionEnum.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -170,7 +170,7 @@ "description": "Exhaustive enum mixed", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveEnumMixed.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -178,7 +178,7 @@ "description": "Empty condition with expression", "path": "compiler/testData/diagnostics/tests/when/EmptyConditionWithExpression.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ], "9": [ @@ -188,7 +188,7 @@ "description": "When", "path": "compiler/testData/diagnostics/tests/when/When.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ], "10": [ @@ -198,7 +198,7 @@ "description": "When", "path": "compiler/testData/diagnostics/tests/when/When.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -206,7 +206,7 @@ "description": "Redundant else", "path": "compiler/testData/diagnostics/tests/when/RedundantElse.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] }, @@ -260,7 +260,7 @@ "description": "Branch false bypass", "path": "compiler/testData/diagnostics/tests/when/BranchFalseBypass.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -268,7 +268,7 @@ "description": "Branch false bypass else", "path": "compiler/testData/diagnostics/tests/when/BranchFalseBypassElse.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -276,7 +276,7 @@ "description": "Kt10809", "path": "compiler/testData/diagnostics/tests/when/kt10809.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ], "10": [ @@ -342,7 +342,7 @@ "description": "Annotated when statement", "path": "compiler/testData/diagnostics/tests/when/AnnotatedWhenStatement.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -350,7 +350,7 @@ "description": "Kt4434", "path": "compiler/testData/diagnostics/tests/when/kt4434.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -358,7 +358,7 @@ "description": "Exhaustive initialization", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveInitialization.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] } @@ -392,7 +392,7 @@ "description": "Empty condition with expression enum", "path": "compiler/testData/diagnostics/tests/when/EmptyConditionWithExpressionEnum.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -400,7 +400,7 @@ "description": "Empty condition with expression", "path": "compiler/testData/diagnostics/tests/when/EmptyConditionWithExpression.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ], "2": [ @@ -410,7 +410,7 @@ "description": "Empty condition with expression enum", "path": "compiler/testData/diagnostics/tests/when/EmptyConditionWithExpressionEnum.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -418,7 +418,7 @@ "description": "Empty condition with expression", "path": "compiler/testData/diagnostics/tests/when/EmptyConditionWithExpression.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] } @@ -490,7 +490,7 @@ "description": "When and lambda with expected type", "path": "compiler/testData/diagnostics/tests/when/whenAndLambdaWithExpectedType.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -498,7 +498,7 @@ "description": "Reserved exhaustive when", "path": "compiler/testData/diagnostics/tests/when/ReservedExhaustiveWhen.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -506,7 +506,7 @@ "description": "When with nothing and lambdas", "path": "compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ], "5": [ @@ -516,7 +516,7 @@ "description": "When", "path": "compiler/testData/diagnostics/tests/when/When.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] }, @@ -570,7 +570,7 @@ "description": "Kt10811", "path": "compiler/testData/diagnostics/tests/when/kt10811.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -578,7 +578,7 @@ "description": "Kt9972", "path": "compiler/testData/diagnostics/tests/when/kt9972.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -586,7 +586,7 @@ "description": "Comma in when condition without argument", "path": "compiler/testData/diagnostics/tests/when/CommaInWhenConditionWithoutArgument.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -594,7 +594,7 @@ "description": "Kt10809", "path": "compiler/testData/diagnostics/tests/when/kt10809.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ], "4": [ @@ -604,7 +604,7 @@ "description": "Duplicated labels", "path": "compiler/testData/diagnostics/tests/when/DuplicatedLabels.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ], "5": [ @@ -614,7 +614,7 @@ "description": "Duplicated labels", "path": "compiler/testData/diagnostics/tests/when/DuplicatedLabels.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] } @@ -644,7 +644,7 @@ "description": "Annotated when statement", "path": "compiler/testData/diagnostics/tests/when/AnnotatedWhenStatement.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -652,7 +652,7 @@ "description": "Exhaustive platform enum else", "path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumElse.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -660,7 +660,7 @@ "description": "Branch false bypass", "path": "compiler/testData/diagnostics/tests/when/BranchFalseBypass.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -668,7 +668,7 @@ "description": "Exhaustive with nullability check before", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckBefore.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -676,7 +676,7 @@ "description": "Exhaustive with nullability check else", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckElse.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -684,7 +684,7 @@ "description": "Kt4434", "path": "compiler/testData/diagnostics/tests/when/kt4434.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -692,7 +692,7 @@ "description": "Duplicated labels", "path": "compiler/testData/diagnostics/tests/when/DuplicatedLabels.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -700,7 +700,7 @@ "description": "Kt10811", "path": "compiler/testData/diagnostics/tests/when/kt10811.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -708,7 +708,7 @@ "description": "Exhaustive platform enum statement", "path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumStatement.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -716,7 +716,7 @@ "description": "Exhaustive platform enum", "path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnum.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -724,7 +724,7 @@ "description": "Comma in when condition without argument", "path": "compiler/testData/diagnostics/tests/when/CommaInWhenConditionWithoutArgument.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -732,7 +732,7 @@ "description": "Exhaustive nullable", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveNullable.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -740,7 +740,7 @@ "description": "Branch false bypass else", "path": "compiler/testData/diagnostics/tests/when/BranchFalseBypassElse.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -748,7 +748,7 @@ "description": "Exhaustive initialization", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveInitialization.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -756,7 +756,7 @@ "description": "Exhaustive with nullability check", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheck.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -764,7 +764,7 @@ "description": "Exhaustive with nullability check boolean", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckBoolean.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -772,7 +772,7 @@ "description": "Exhaustive platform enum annotated", "path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumAnnotated.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -780,7 +780,7 @@ "description": "No else when statement", "path": "compiler/testData/diagnostics/tests/when/NoElseWhenStatement.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -788,7 +788,7 @@ "description": "Kt10809", "path": "compiler/testData/diagnostics/tests/when/kt10809.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -796,7 +796,7 @@ "description": "Kt10439", "path": "compiler/testData/diagnostics/tests/when/kt10439.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -804,7 +804,7 @@ "description": "Non exhaustive boolean nullable", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveBooleanNullable.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -812,7 +812,7 @@ "description": "Exhaustive no initialization", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveNoInitialization.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -820,7 +820,7 @@ "description": "Exhaustive return throw", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveReturnThrow.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -828,7 +828,7 @@ "description": "Exhaustive return", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveReturn.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -836,7 +836,7 @@ "description": "Exhaustive platform enum null", "path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumNull.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] }, @@ -848,7 +848,7 @@ "description": "When type disjunctions", "path": "compiler/testData/diagnostics/tests/when/WhenTypeDisjunctions.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -856,7 +856,7 @@ "description": "Exhaustive boolean nullable", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanNullable.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -864,7 +864,7 @@ "description": "Non exhaustive warning null", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningNull.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -872,7 +872,7 @@ "description": "No else returned unit", "path": "compiler/testData/diagnostics/tests/when/NoElseReturnedUnit.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -880,7 +880,7 @@ "description": "No else expected unit", "path": "compiler/testData/diagnostics/tests/when/NoElseExpectedUnit.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -888,7 +888,7 @@ "description": "Branch bypass val", "path": "compiler/testData/diagnostics/tests/when/BranchBypassVal.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -896,7 +896,7 @@ "description": "Non exhaustive warning", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarning.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -904,7 +904,7 @@ "description": "Exhaustive val over conditional init", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveValOverConditionalInit.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -912,7 +912,7 @@ "description": "Exhaustive boolean brackets", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanBrackets.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -920,7 +920,7 @@ "description": "When", "path": "compiler/testData/diagnostics/tests/when/When.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -928,7 +928,7 @@ "description": "Exhaustive boolean complex", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanComplex.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -936,7 +936,7 @@ "description": "No else returned coercion to unit", "path": "compiler/testData/diagnostics/tests/when/NoElseReturnedCoercionToUnit.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -944,7 +944,7 @@ "description": "Non exhaustive warning false", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningFalse.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -952,7 +952,7 @@ "description": "Non exhaustive warning for sealed class", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningForSealedClass.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -960,7 +960,7 @@ "description": "Reserved exhaustive when", "path": "compiler/testData/diagnostics/tests/when/ReservedExhaustiveWhen.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -968,7 +968,7 @@ "description": "Exhaustive boolean", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveBoolean.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -976,7 +976,7 @@ "description": "Branch bypass var", "path": "compiler/testData/diagnostics/tests/when/BranchBypassVar.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -984,7 +984,7 @@ "description": "Non exhaustive platform enum", "path": "compiler/testData/diagnostics/tests/when/NonExhaustivePlatformEnum.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -992,7 +992,7 @@ "description": "No else returned from lambda expected int", "path": "compiler/testData/diagnostics/tests/when/NoElseReturnedFromLambdaExpectedInt.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -1000,7 +1000,7 @@ "description": "Exhaustive var over conditional init", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveVarOverConditionalInit.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -1008,7 +1008,7 @@ "description": "Empty condition with expression enum", "path": "compiler/testData/diagnostics/tests/when/EmptyConditionWithExpressionEnum.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -1016,7 +1016,7 @@ "description": "Exhaustive enum mixed", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveEnumMixed.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -1024,7 +1024,7 @@ "description": "Empty condition with expression", "path": "compiler/testData/diagnostics/tests/when/EmptyConditionWithExpression.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -1032,7 +1032,7 @@ "description": "Property not initialized", "path": "compiler/testData/diagnostics/tests/when/PropertyNotInitialized.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -1040,7 +1040,7 @@ "description": "Non exhaustive warning else", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningElse.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -1048,7 +1048,7 @@ "description": "Redundant else", "path": "compiler/testData/diagnostics/tests/when/RedundantElse.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -1056,7 +1056,7 @@ "description": "Non exhaustive with nullability check", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWithNullabilityCheck.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -1064,7 +1064,7 @@ "description": "No else no expected type", "path": "compiler/testData/diagnostics/tests/when/NoElseNoExpectedType.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -1072,7 +1072,7 @@ "description": "Exhaustive enum is", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveEnumIs.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -1080,7 +1080,7 @@ "description": "No else returned non unit", "path": "compiler/testData/diagnostics/tests/when/NoElseReturnedNonUnit.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -1088,7 +1088,7 @@ "description": "Exhaustive break continue", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveBreakContinue.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -1096,7 +1096,7 @@ "description": "Top level sealed", "path": "compiler/testData/diagnostics/tests/when/TopLevelSealed.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -1104,7 +1104,7 @@ "description": "Else on nullable enum", "path": "compiler/testData/diagnostics/tests/when/ElseOnNullableEnum.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -1112,7 +1112,7 @@ "description": "Else on nullable enum with smart cast", "path": "compiler/testData/diagnostics/tests/when/ElseOnNullableEnumWithSmartCast.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] } @@ -1126,7 +1126,7 @@ "description": "Annotated when statement", "path": "compiler/testData/diagnostics/tests/when/AnnotatedWhenStatement.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -1134,7 +1134,7 @@ "description": "No else when statement", "path": "compiler/testData/diagnostics/tests/when/NoElseWhenStatement.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ], "1": [ @@ -1144,7 +1144,7 @@ "description": "Duplicated labels", "path": "compiler/testData/diagnostics/tests/when/DuplicatedLabels.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -1152,7 +1152,7 @@ "description": "Kt9972", "path": "compiler/testData/diagnostics/tests/when/kt9972.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -1160,7 +1160,7 @@ "description": "Kt10809", "path": "compiler/testData/diagnostics/tests/when/kt10809.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -1168,7 +1168,7 @@ "description": "Kt10439", "path": "compiler/testData/diagnostics/tests/when/kt10439.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] }, @@ -1180,7 +1180,7 @@ "description": "Non exhaustive warning null", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningNull.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -1188,7 +1188,7 @@ "description": "No else returned unit", "path": "compiler/testData/diagnostics/tests/when/NoElseReturnedUnit.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -1196,7 +1196,7 @@ "description": "No else expected unit", "path": "compiler/testData/diagnostics/tests/when/NoElseExpectedUnit.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -1204,7 +1204,7 @@ "description": "Non exhaustive warning", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarning.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -1212,7 +1212,7 @@ "description": "No else returned coercion to unit", "path": "compiler/testData/diagnostics/tests/when/NoElseReturnedCoercionToUnit.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -1220,7 +1220,7 @@ "description": "Non exhaustive warning for sealed class", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningForSealedClass.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -1228,7 +1228,7 @@ "description": "No else returned from lambda expected int", "path": "compiler/testData/diagnostics/tests/when/NoElseReturnedFromLambdaExpectedInt.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -1236,7 +1236,7 @@ "description": "Non exhaustive with nullability check", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWithNullabilityCheck.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -1244,7 +1244,7 @@ "description": "No else no expected type", "path": "compiler/testData/diagnostics/tests/when/NoElseNoExpectedType.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -1252,7 +1252,7 @@ "description": "No else returned non unit", "path": "compiler/testData/diagnostics/tests/when/NoElseReturnedNonUnit.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] } 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 b2b0a6c7368..24c59c8e8cd 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 @@ -8,7 +8,7 @@ "description": "When and lambda with expected type", "path": "compiler/testData/diagnostics/tests/when/whenAndLambdaWithExpectedType.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -16,7 +16,7 @@ "description": "No else returned from lambda expected int", "path": "compiler/testData/diagnostics/tests/when/NoElseReturnedFromLambdaExpectedInt.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] }, @@ -28,7 +28,7 @@ "description": "Kt10439", "path": "compiler/testData/diagnostics/tests/when/kt10439.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] } @@ -42,7 +42,7 @@ "description": "When with nothing and lambdas", "path": "compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] } 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 c72e4947361..9a0a55a05ba 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 @@ -8,7 +8,7 @@ "description": "Kt10439", "path": "compiler/testData/diagnostics/tests/when/kt10439.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] } 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 52d9bfd3603..1875fc05683 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 @@ -8,7 +8,7 @@ "description": "When and lambda with expected type", "path": "compiler/testData/diagnostics/tests/when/whenAndLambdaWithExpectedType.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] }, @@ -20,7 +20,7 @@ "description": "Kt10811", "path": "compiler/testData/diagnostics/tests/when/kt10811.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -28,7 +28,7 @@ "description": "Kt10809", "path": "compiler/testData/diagnostics/tests/when/kt10809.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] } @@ -42,7 +42,7 @@ "description": "Kt10811", "path": "compiler/testData/diagnostics/tests/when/kt10811.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -50,7 +50,7 @@ "description": "Kt10809", "path": "compiler/testData/diagnostics/tests/when/kt10809.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] } 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 bbdeb5d4ef1..3e28ecfca3f 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 @@ -8,7 +8,7 @@ "description": "Branch false bypass", "path": "compiler/testData/diagnostics/tests/when/BranchFalseBypass.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -16,7 +16,7 @@ "description": "Exhaustive with nullability check before", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckBefore.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -24,7 +24,7 @@ "description": "Exhaustive with nullability check else", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckElse.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -32,7 +32,7 @@ "description": "Branch false bypass else", "path": "compiler/testData/diagnostics/tests/when/BranchFalseBypassElse.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -40,7 +40,7 @@ "description": "Exhaustive with nullability check", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheck.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -48,7 +48,7 @@ "description": "Exhaustive with nullability check boolean", "path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckBoolean.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -56,7 +56,7 @@ "description": "Kt10809", "path": "compiler/testData/diagnostics/tests/when/kt10809.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ], "8": [ @@ -66,7 +66,7 @@ "description": "Branch false bypass", "path": "compiler/testData/diagnostics/tests/when/BranchFalseBypass.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -74,7 +74,7 @@ "description": "Branch false bypass else", "path": "compiler/testData/diagnostics/tests/when/BranchFalseBypassElse.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] }, @@ -86,7 +86,7 @@ "description": "When type disjunctions", "path": "compiler/testData/diagnostics/tests/when/WhenTypeDisjunctions.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -94,7 +94,7 @@ "description": "Branch bypass val", "path": "compiler/testData/diagnostics/tests/when/BranchBypassVal.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -102,7 +102,7 @@ "description": "Non exhaustive warning for sealed class", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningForSealedClass.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-313", @@ -110,7 +110,7 @@ "description": "Branch bypass var", "path": "compiler/testData/diagnostics/tests/when/BranchBypassVar.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" }, { "specVersion": "0.1-152", @@ -118,7 +118,7 @@ "description": "Non exhaustive with nullability check", "path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWithNullabilityCheck.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ], "6": [ @@ -128,7 +128,7 @@ "description": "Branch bypass val", "path": "compiler/testData/diagnostics/tests/when/BranchBypassVal.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ], "8": [ @@ -138,7 +138,7 @@ "description": "Branch bypass var", "path": "compiler/testData/diagnostics/tests/when/BranchBypassVar.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] } 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 0622bd0d057..751bcd1f4f5 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 @@ -8,7 +8,7 @@ "description": "Kt10811", "path": "compiler/testData/diagnostics/tests/when/kt10811.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ], "2": [ @@ -18,7 +18,7 @@ "description": "Kt10811", "path": "compiler/testData/diagnostics/tests/when/kt10811.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] } 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 adff903c87e..e98ccccbb55 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 @@ -8,7 +8,7 @@ "description": "When and lambda with expected type", "path": "compiler/testData/diagnostics/tests/when/whenAndLambdaWithExpectedType.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] }, @@ -20,7 +20,7 @@ "description": "Kt10811", "path": "compiler/testData/diagnostics/tests/when/kt10811.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] } 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 8c6c35b5264..9eb4b461632 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 @@ -8,7 +8,7 @@ "description": "Kt10809", "path": "compiler/testData/diagnostics/tests/when/kt10809.kt", "unexpectedBehaviour": false, - "linkType": "main" + "linkType": "primary" } ] } 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 a2593d19d94..b0ba2f51573 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 @@ -15,7 +15,6 @@ import org.jetbrains.kotlin.spec.utils.spec.SpecSentencesStorage import org.junit.Test import org.junit.runner.RunWith import java.io.File -import kotlin.io.walkTopDown @TestDataPath("\$PROJECT_ROOT/compiler/tests-spec/testData/") @RunWith(com.intellij.testFramework.Parameterized::class) @@ -55,8 +54,9 @@ class SpecTestsConsistencyTest : TestCase() { val file = File("${GeneralConfiguration.SPEC_TESTDATA_PATH}/${testFilePath.replace("$", "/")}") val specSentences = specSentencesStorage.getLatest() ?: return val test = parseLinkedSpecTest(file.canonicalPath, mapOf("main" to file.readText())) - val sectionsPath = setOf(*test.place.sections.toTypedArray(), test.place.paragraphNumber).joinToString() - val sentenceNumber = test.place.sentenceNumber + if (test.mainLink == null) return //todo add check for relevant links also + val sectionsPath = setOf(*test.mainLink.sections.toTypedArray(), test.mainLink.paragraphNumber).joinToString() + val sentenceNumber = test.mainLink.sentenceNumber val paragraphSentences = specSentences[sectionsPath] if (paragraphSentences != null && paragraphSentences.size >= sentenceNumber) { @@ -76,5 +76,6 @@ class SpecTestsConsistencyTest : TestCase() { assertEquals(expectedSentence, actualSentence) } + } } 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 c4469e7780b..ce23b93c3c2 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 @@ -35,7 +35,7 @@ object TestsJsonMapGenerator { return testsByType.getOrCreate(specPlace.sentenceNumber.toString()) } - enum class LinkType{ + enum class LinkType { MAIN, PRIMARY, SECONDARY; @@ -44,6 +44,7 @@ object TestsJsonMapGenerator { return name.toLowerCase() } } + private fun getTestInfo(test: LinkedSpecTest, testFile: File? = null, linkType: LinkType = LinkType.MAIN) = JsonObject().apply { addProperty("specVersion", test.specVersion) @@ -57,6 +58,29 @@ object TestsJsonMapGenerator { addProperty("linkType", linkType.toString()) } + + private fun collectInfoFromTests( + testsMap: JsonObject, + testDataPath: String, + linkedTestsPath: String = "" + ) { + TestArea.values().forEach { testArea -> + val filePath = buildString { + append("${testDataPath}/${testArea.testDataPath}") + if (linkedTestsPath.isNotEmpty()) + append("/${linkedTestsPath}") + } + File(filePath).walkTopDown() + .forEach testFiles@{ file -> + if (!file.isFile || file.extension != "kt" || file.name.endsWith(".fir.kt")) return@testFiles + val (specTest, _) = CommonParser.parseSpecTest(file.canonicalPath, mapOf("main.kt" to file.readText())) + if (specTest is LinkedSpecTest) { + collectInfoFromTests(testsMap = testsMap, specTest = specTest, file = file) + } + } + } + } + private fun collectInfoFromSpecTests(testsMap: JsonObject) { TestArea.values().forEach { testArea -> File("${GeneralConfiguration.SPEC_TESTDATA_PATH}/${testArea.testDataPath}/$LINKED_TESTS_PATH").walkTopDown() @@ -64,13 +88,7 @@ object TestsJsonMapGenerator { if (!file.isFile || file.extension != "kt" || file.name.endsWith(".fir.kt")) return@testFiles val (specTest, _) = CommonParser.parseSpecTest(file.canonicalPath, mapOf("main.kt" to file.readText())) if (specTest is LinkedSpecTest) { - collectInfoFromTestsTemp( - testsMap = testsMap, - specTest = specTest, - testInfoForMainLink = getTestInfo(specTest, file, LinkType.MAIN), - testInfoForPrimaryLink = getTestInfo(specTest, file, LinkType.PRIMARY), - testInfoForSecondaryLink = getTestInfo(specTest, file, LinkType.SECONDARY) - ) + collectInfoFromTests(testsMap = testsMap, specTest = specTest, file = file) } } } @@ -83,46 +101,34 @@ object TestsJsonMapGenerator { if (!file.isFile || file.extension != "kt") return@testFiles if (!LinkedSpecTestPatterns.testInfoPattern.matcher(file.readText()).find()) return@testFiles - val (specTest, _) = CommonParser.parseImplTest(file.canonicalPath, mapOf("main.kt" to file.readText())) - collectInfoFromTests(testsMap, specTest, getTestInfo(specTest, file)) + val (specTest, _) = CommonParser.parseSpecTest(file.canonicalPath, mapOf("main.kt" to file.readText()), true) + if (specTest is LinkedSpecTest) { + collectInfoFromTests(testsMap = testsMap, specTest = specTest, file = file) + } } } } - private fun collectInfoFromTests( - testsMap: JsonObject, - specTest: LinkedSpecTest, - testInfoForMainLink: JsonObject, - testInfoForRelevantLink: JsonObject = testInfoForMainLink - ) { - testsMap.getOrCreateSpecTestObject(specTest.place, specTest.testArea, specTest.testType).add(testInfoForMainLink) - specTest.primaryLinks?.forEach { - testsMap.getOrCreateSpecTestObject(it, specTest.testArea, specTest.testType).add(testInfoForRelevantLink) - } - specTest.secondaryLinks?.forEach { - testsMap.getOrCreateSpecTestObject(it, specTest.testArea, specTest.testType).add(testInfoForRelevantLink) - } - } - private fun collectInfoFromTestsTemp( //todo add same for implementation tests - testsMap: JsonObject, - specTest: LinkedSpecTest, - testInfoForMainLink: JsonObject, - testInfoForPrimaryLink: JsonObject = testInfoForMainLink, - testInfoForSecondaryLink: JsonObject = testInfoForMainLink + private fun collectInfoFromTests( + testsMap: JsonObject, specTest: LinkedSpecTest, file: File ) { - testsMap.getOrCreateSpecTestObject(specTest.place, specTest.testArea, specTest.testType).add(testInfoForMainLink) + + if (specTest.mainLink != null) + testsMap.getOrCreateSpecTestObject(specTest.mainLink, specTest.testArea, specTest.testType) + .add(getTestInfo(specTest, file, LinkType.MAIN)) specTest.primaryLinks?.forEach { - testsMap.getOrCreateSpecTestObject(it, specTest.testArea, specTest.testType).add(testInfoForPrimaryLink) + testsMap.getOrCreateSpecTestObject(it, specTest.testArea, specTest.testType).add(getTestInfo(specTest, file, LinkType.PRIMARY)) } specTest.secondaryLinks?.forEach { - testsMap.getOrCreateSpecTestObject(it, specTest.testArea, specTest.testType).add(testInfoForSecondaryLink) + testsMap.getOrCreateSpecTestObject(it, specTest.testArea, specTest.testType) + .add(getTestInfo(specTest, file, LinkType.SECONDARY)) } } fun buildTestsMapPerSection() { val testsMap = JsonObject().apply { - collectInfoFromSpecTests(this) + collectInfoFromTests(this, GeneralConfiguration.SPEC_TESTDATA_PATH, LINKED_TESTS_PATH) collectInfoFromImplementationTests(this) } 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 79a07bb76b2..b23fb4a0a92 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 @@ -10,12 +10,12 @@ import org.jetbrains.kotlin.spec.utils.SpecTestCasesSet import org.jetbrains.kotlin.spec.utils.SpecTestInfoElementType import org.jetbrains.kotlin.spec.utils.TestArea import org.jetbrains.kotlin.spec.utils.TestType -import org.jetbrains.kotlin.spec.utils.parsers.LinkedSpecTestPatterns.mainLinkPattern -import org.jetbrains.kotlin.spec.utils.parsers.LinkedSpecTestPatterns.relevantLinksPattern +import org.jetbrains.kotlin.spec.utils.parsers.CommonParser.splitByPathSeparator import org.jetbrains.kotlin.spec.utils.parsers.CommonParser.withSpaces import org.jetbrains.kotlin.spec.utils.parsers.CommonParser.withUnderscores -import org.jetbrains.kotlin.spec.utils.parsers.CommonParser.splitByPathSeparator import org.jetbrains.kotlin.spec.utils.parsers.CommonPatterns.ls +import org.jetbrains.kotlin.spec.utils.parsers.LinkedSpecTestPatterns.mainLinkPattern +import org.jetbrains.kotlin.spec.utils.parsers.LinkedSpecTestPatterns.relevantLinksPattern import java.util.regex.Matcher import java.util.regex.Pattern @@ -40,7 +40,7 @@ class LinkedSpecTest( val specVersion: String, testArea: TestArea, testType: TestType, - val place: SpecPlace, + val mainLink: SpecPlace?, val primaryLinks: Set?, val secondaryLinks: Set?, testNumber: Int, @@ -51,14 +51,25 @@ class LinkedSpecTest( issues: Set, helpers: Set?, exception: TestsExceptionType? -) : AbstractSpecTest(testArea, testType, place.sections, testNumber, description, cases, unexpectedBehavior, issues, helpers, exception) { +) : AbstractSpecTest( + testArea, + testType, + mainLink?.sections ?: listOf(), + testNumber, + description, + cases, + unexpectedBehavior, + issues, + helpers, + exception +) { override fun checkPathConsistency(pathMatcher: Matcher) = testArea == TestArea.valueOf(pathMatcher.group("testArea").withUnderscores()) && testType == TestType.fromValue(pathMatcher.group("testType"))!! && sections == pathMatcher.group("sections").splitByPathSeparator() - && place.paragraphNumber == pathMatcher.group("paragraphNumber").toInt() - && place.sentenceNumber == pathMatcher.group("sentenceNumber").toInt() + && mainLink?.paragraphNumber == pathMatcher.group("paragraphNumber").toInt() + && mainLink.sentenceNumber == pathMatcher.group("sentenceNumber").toInt() && testNumber == pathMatcher.group("testNumber").toInt() private fun getUnspecifiedBehaviourText(): String? { @@ -80,12 +91,19 @@ class LinkedSpecTest( super.getUnexpectedBehaviourText()?.let { append(it + ls) } append("${testArea.name.withSpaces()} $testType SPEC TEST (${testType.toString().withSpaces()})$ls") append("SPEC VERSION: $specVersion$ls") - append("SPEC PLACE: ${sections.joinToString()} -> paragraph: ${place.paragraphNumber} -> sentence: ${place.sentenceNumber}$ls") - primaryLinks?.let { append("PRIMARY LINKS:${it.joinToString { "$ls\t${sections.joinToString()} -> paragraph: ${place.paragraphNumber} -> sentence: ${place.sentenceNumber}" }}$ls") } - secondaryLinks?.let { append("SECONDARY LINKS:${it.joinToString { "$ls\t${sections.joinToString()} -> paragraph: ${place.paragraphNumber} -> sentence: ${place.sentenceNumber}" }}$ls") } + mainLink?.let { append("MAIN LINK: ${sections.joinToString()} -> paragraph: ${mainLink.paragraphNumber} -> sentence: ${mainLink.sentenceNumber}$ls") } + primaryLinks?.let { append("PRIMARY LINKS: ${primaryLinks.buildToString()}$ls") } + secondaryLinks?.let { append("SECONDARY LINKS: ${secondaryLinks.buildToString()}$ls") } append("NUMBER: $testNumber$ls") append("TEST CASES: ${cases.byNumbers.size.coerceAtLeast(1)}$ls") append("DESCRIPTION: $description$ls") super.getIssuesText()?.let { append(it + ls) } } + + private fun Set.buildToString(): String = buildString { + this@buildToString.forEach { + append("${sections.joinToString()} -> paragraph: ${it.paragraphNumber} -> sentence: ${it.sentenceNumber}$ls") + } + } + } 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 26bbc2b1128..14099a11e70 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 @@ -35,14 +35,13 @@ object CommonParser { private fun parseBasePath(pathPartRegex: String, testFilePath: String) = Pattern.compile(testPathBaseRegexTemplate.format(pathPartRegex)).matcher(testFilePath) - fun parseImplTest(testFilePath: String, files: TestFiles): Pair = - Pair(parseLinkedSpecTest(testFilePath, files, isImplementationTest = true), SpecTestLinkedType.LINKED) - - fun parseSpecTest(testFilePath: String, files: TestFiles) = when { + fun parseSpecTest(testFilePath: String, files: TestFiles, isImplementationTest: Boolean = false) = when { isPathMatched(LinkedSpecTestPatterns.pathPartRegex, testFilePath) -> Pair(parseLinkedSpecTest(testFilePath, files), SpecTestLinkedType.LINKED) isPathMatched(NotLinkedSpecTestPatterns.pathPartRegex, testFilePath) -> Pair(parseNotLinkedSpecTest(testFilePath, files), SpecTestLinkedType.NOT_LINKED) + isImplementationTest -> + Pair(parseLinkedSpecTest(testFilePath, files, true), SpecTestLinkedType.LINKED) else -> throw SpecTestValidationException(SpecTestValidationFailedReason.FILENAME_NOT_VALID) } @@ -54,51 +53,38 @@ object CommonParser { placeMatcher.group("sentenceNumber").toInt() ) - private fun parseRelevantPlaces( - placesMatcher: Matcher?, - relevantPlaces: MutableSet - ) { - if (placesMatcher == null) - return - placesMatcher?.let { - relevantPlaces.add(createSpecPlace(it, placesMatcher)) - while (it.find()) { - relevantPlaces.add(createSpecPlace(it, placesMatcher)) + class RelevantLinks(linksMatcher: Matcher?) { + val linksSet: MutableSet = mutableSetOf() + + init { + if (linksMatcher != null) { + linksSet.add(createSpecPlace(linksMatcher)) + while (linksMatcher.find()) { + linksSet.add(createSpecPlace(linksMatcher)) + } } } } + fun parseLinkedSpecTest(testFilePath: String, testFiles: TestFiles, isImplementationTest: Boolean = false): LinkedSpecTest { - val primaryLinks = mutableSetOf() - val secondaryLinks = mutableSetOf() + val parsedTestFile = tryParseTestInfo(testFilePath, testFiles, SpecTestLinkedType.LINKED, isImplementationTest) val testInfoElements = parsedTestFile.testInfoElements - parseRelevantPlaces( - testInfoElements[LinkedSpecTestFileInfoElementType.PRIMARY_LINKS]?.additionalMatcher, - primaryLinks - ) - - parseRelevantPlaces( - testInfoElements[LinkedSpecTestFileInfoElementType.SECONDARY_LINKS]?.additionalMatcher, - secondaryLinks - ) + val primaryLinks = + RelevantLinks(testInfoElements[LinkedSpecTestFileInfoElementType.PRIMARY_LINKS]?.additionalMatcher).linksSet + val secondaryLinks = + RelevantLinks(testInfoElements[LinkedSpecTestFileInfoElementType.SECONDARY_LINKS]?.additionalMatcher).linksSet val placeMatcher = testInfoElements[LinkedSpecTestFileInfoElementType.MAIN_LINK]?.additionalMatcher - val mainPlace: SpecPlace - if (placeMatcher != null) { - mainPlace = createSpecPlace(placeMatcher) - } else { - mainPlace = primaryLinks.first() - primaryLinks.remove(mainPlace) - } return LinkedSpecTest( testInfoElements[LinkedSpecTestFileInfoElementType.SPEC_VERSION]!!.content, parsedTestFile.testArea, parsedTestFile.testType, - mainPlace, + placeMatcher?.let { createSpecPlace(placeMatcher) }, primaryLinks, secondaryLinks, parsedTestFile.testNumber, @@ -157,9 +143,9 @@ object CommonParser { rawElements: String, ) = when (testInfoOriginalElementName) { LinkedSpecTestPatterns.PRIMARY_LINKS -> - groupRelevantAndAlternativePlaces(LinkedSpecTestPatterns.primaryLinks, rawElements, testInfoOriginalElementName) + groupRelevantLinks(LinkedSpecTestPatterns.primaryLinks, rawElements, testInfoOriginalElementName) LinkedSpecTestPatterns.SECONDARY_LINKS -> - groupRelevantAndAlternativePlaces(LinkedSpecTestPatterns.secondaryLinks, rawElements, testInfoOriginalElementName) + groupRelevantLinks(LinkedSpecTestPatterns.secondaryLinks, rawElements, testInfoOriginalElementName) else -> testInfoElementMatcher.group("value") } @@ -204,14 +190,14 @@ object CommonParser { } - private fun groupRelevantAndAlternativePlaces(placesPattern: Pattern, rawElements: String, linkType: String): String { - val placesMatcher = placesPattern.matcher(rawElements) + private fun groupRelevantLinks(linksPattern: Pattern, rawElements: String, linkType: String): String { + val placesMatcher = linksPattern.matcher(rawElements) if (placesMatcher.find()) { return placesMatcher.group("places") } else throw Exception("$linkType link is incorrect") } - fun testInfoFilter(fileContent: String) = + fun testInfoFilter(fileContent: String): String = testInfoPattern.matcher(fileContent).replaceAll("").let { testCaseInfoPattern.matcher(it).replaceAll("") } diff --git a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/parsers/Patterns.kt b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/parsers/Patterns.kt index 595d2cf0abf..dd9f0e9d31b 100644 --- a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/parsers/Patterns.kt +++ b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/parsers/Patterns.kt @@ -21,7 +21,6 @@ import org.jetbrains.kotlin.spec.utils.parsers.CommonPatterns.sectionsInPathRege import org.jetbrains.kotlin.spec.utils.parsers.CommonPatterns.testAreaRegex import org.jetbrains.kotlin.spec.utils.parsers.CommonPatterns.testPathRegexTemplate import org.jetbrains.kotlin.spec.utils.parsers.CommonPatterns.testTypeRegex -import org.jetbrains.kotlin.spec.utils.parsers.CommonPatterns.ws import java.io.File import java.util.regex.Pattern @@ -35,7 +34,6 @@ object CommonPatterns { val ls: String = System.lineSeparator() val ps: String = Pattern.quote(File.separator) - val ws = """\s*""" val directiveRegex = """${SINGLE_LINE_COMMENT_REGEX.format("""[\w\s]+:""")}|${MULTILINE_COMMENT_REGEX.format(""" $ASTERISK_REGEX [\w\s]+:[\s\S]*?""")}""" @@ -88,8 +86,8 @@ object LinkedSpecTestPatterns : BasePatterns { private val linkRegex = Regex("""(( $ASTERISK_REGEX )?\s*($SECTIONS_IN_FILE_REGEX -> )?(paragraph $INTEGER_REGEX -> )?sentence $INTEGER_REGEX)""") - val primaryLinks: Pattern = Pattern.compile("""$PRIMARY_LINKS$ws:$ws(?(${linkRegex}(\s)*\n)+)""") - val secondaryLinks: Pattern = Pattern.compile("""$SECONDARY_LINKS$ws:$ws(?(${linkRegex}(\s)*\n)+)""") + val primaryLinks: Pattern = Pattern.compile("""$PRIMARY_LINKS\s*:\s*(?(${linkRegex}(\s)*\n)+)""") + val secondaryLinks: Pattern = Pattern.compile("""$SECONDARY_LINKS\s*:\s*(?(${linkRegex}(\s)*\n)+)""") } object TestCasePatterns {