From 3fc7e0ed03344cb864ca9fe6bed1bce9ad1afa29 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Thu, 20 May 2021 17:43:36 +0300 Subject: [PATCH] [FIR] Remove COMPARE_WITH_LIGHT_TREE from default directives of fir diagnostic tests --- .../testData/resolveWithStdlib/listPlusAssign.kt | 4 +++- .../src/org/jetbrains/kotlin/fir/builder/FirBuilderDsl.kt | 2 +- .../diagnostics/tests/FunctionCalleeExpressions.fir.kt | 1 + .../testData/diagnostics/tests/FunctionCalleeExpressions.kt | 1 + .../diagnostics/tests/annotations/kt1860-negative.fir.kt | 1 + .../testData/diagnostics/tests/annotations/kt1860-negative.kt | 1 + .../diagnostics/tests/annotations/kt1860-positive.fir.kt | 1 + .../testData/diagnostics/tests/annotations/kt1860-positive.kt | 1 + .../diagnosticFileAnnotationInWrongPlace.fir.kt | 3 ++- .../withUseSiteTarget/diagnosticFileAnnotationInWrongPlace.kt | 3 ++- .../withUseSiteTarget/diagnosticWithoutPackage.fir.kt | 3 ++- .../annotations/withUseSiteTarget/diagnosticWithoutPackage.kt | 3 ++- .../checkBackingFieldException.fir.kt | 1 + .../diagnosticWithSyntaxError/checkBackingFieldException.kt | 1 + compiler/testData/diagnostics/tests/kt435.fir.kt | 1 + compiler/testData/diagnostics/tests/kt435.kt | 3 ++- compiler/testData/diagnostics/tests/objects/Objects.fir.kt | 1 + compiler/testData/diagnostics/tests/objects/Objects.kt | 1 + compiler/testData/diagnostics/tests/regressions/kt328.fir.kt | 1 + compiler/testData/diagnostics/tests/regressions/kt328.kt | 1 + .../tests/resolve/nestedCalls/kt5971NestedSafeCall.fir.kt | 1 + .../tests/resolve/nestedCalls/kt5971NestedSafeCall.kt | 1 + .../kotlin/test/runners/AbstractFirDiagnosticTest.kt | 4 ---- .../testData/diagnostics/notLinked/dfa/pos/68.fir.kt | 1 + .../tests-spec/testData/diagnostics/notLinked/dfa/pos/68.kt | 3 ++- 25 files changed, 32 insertions(+), 12 deletions(-) diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/listPlusAssign.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/listPlusAssign.kt index 1222881d8fb..72552d2d321 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/listPlusAssign.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/listPlusAssign.kt @@ -1,3 +1,5 @@ +// COMPARE_WITH_LIGHT_TREE + fun List.modify() { this += "Alpha" this += "Omega" @@ -16,4 +18,4 @@ fun Set.modify() { fun Any.modifySet() { (this as Set) += 42 -} \ No newline at end of file +} diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/builder/FirBuilderDsl.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/builder/FirBuilderDsl.kt index 758d4416cca..1d6e78e193d 100644 --- a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/builder/FirBuilderDsl.kt +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/builder/FirBuilderDsl.kt @@ -6,4 +6,4 @@ package org.jetbrains.kotlin.fir.builder @DslMarker -annotation class FirBuilderDsl \ No newline at end of file +annotation class FirBuilderDsl diff --git a/compiler/testData/diagnostics/tests/FunctionCalleeExpressions.fir.kt b/compiler/testData/diagnostics/tests/FunctionCalleeExpressions.fir.kt index eeda3af3a2d..b2f78d008b9 100644 --- a/compiler/testData/diagnostics/tests/FunctionCalleeExpressions.fir.kt +++ b/compiler/testData/diagnostics/tests/FunctionCalleeExpressions.fir.kt @@ -1,3 +1,4 @@ +// COMPARE_WITH_LIGHT_TREE // !WITH_NEW_INFERENCE // !CHECK_TYPE diff --git a/compiler/testData/diagnostics/tests/FunctionCalleeExpressions.kt b/compiler/testData/diagnostics/tests/FunctionCalleeExpressions.kt index 5851eae342b..8676b9e0f23 100644 --- a/compiler/testData/diagnostics/tests/FunctionCalleeExpressions.kt +++ b/compiler/testData/diagnostics/tests/FunctionCalleeExpressions.kt @@ -1,3 +1,4 @@ +// COMPARE_WITH_LIGHT_TREE // !WITH_NEW_INFERENCE // !CHECK_TYPE diff --git a/compiler/testData/diagnostics/tests/annotations/kt1860-negative.fir.kt b/compiler/testData/diagnostics/tests/annotations/kt1860-negative.fir.kt index 1eff500f804..8be3f456775 100644 --- a/compiler/testData/diagnostics/tests/annotations/kt1860-negative.fir.kt +++ b/compiler/testData/diagnostics/tests/annotations/kt1860-negative.fir.kt @@ -1,3 +1,4 @@ +// COMPARE_WITH_LIGHT_TREE // !WITH_NEW_INFERENCE fun foo(@varargs f : Int) {} diff --git a/compiler/testData/diagnostics/tests/annotations/kt1860-negative.kt b/compiler/testData/diagnostics/tests/annotations/kt1860-negative.kt index 10b6ba00a27..c80fce6eb25 100644 --- a/compiler/testData/diagnostics/tests/annotations/kt1860-negative.kt +++ b/compiler/testData/diagnostics/tests/annotations/kt1860-negative.kt @@ -1,3 +1,4 @@ +// COMPARE_WITH_LIGHT_TREE // !WITH_NEW_INFERENCE fun foo(@varargs f : Int) {} diff --git a/compiler/testData/diagnostics/tests/annotations/kt1860-positive.fir.kt b/compiler/testData/diagnostics/tests/annotations/kt1860-positive.fir.kt index 311ce46913a..ccde52c566b 100644 --- a/compiler/testData/diagnostics/tests/annotations/kt1860-positive.fir.kt +++ b/compiler/testData/diagnostics/tests/annotations/kt1860-positive.fir.kt @@ -1,3 +1,4 @@ +// COMPARE_WITH_LIGHT_TREE // !WITH_NEW_INFERENCE @Target(AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.EXPRESSION) @Retention(AnnotationRetention.SOURCE) diff --git a/compiler/testData/diagnostics/tests/annotations/kt1860-positive.kt b/compiler/testData/diagnostics/tests/annotations/kt1860-positive.kt index 66565a9af09..50e1d48c1f4 100644 --- a/compiler/testData/diagnostics/tests/annotations/kt1860-positive.kt +++ b/compiler/testData/diagnostics/tests/annotations/kt1860-positive.kt @@ -1,3 +1,4 @@ +// COMPARE_WITH_LIGHT_TREE // !WITH_NEW_INFERENCE @Target(AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.EXPRESSION) @Retention(AnnotationRetention.SOURCE) diff --git a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/diagnosticFileAnnotationInWrongPlace.fir.kt b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/diagnosticFileAnnotationInWrongPlace.fir.kt index 6483447f8ac..6b535ddf289 100644 --- a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/diagnosticFileAnnotationInWrongPlace.fir.kt +++ b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/diagnosticFileAnnotationInWrongPlace.fir.kt @@ -1,3 +1,4 @@ +// COMPARE_WITH_LIGHT_TREE package bar @file:foo @@ -17,4 +18,4 @@ interface T annotation class foo annotation class bar -annotation class baz \ No newline at end of file +annotation class baz diff --git a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/diagnosticFileAnnotationInWrongPlace.kt b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/diagnosticFileAnnotationInWrongPlace.kt index 0c68f080eda..8d8dde0350d 100644 --- a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/diagnosticFileAnnotationInWrongPlace.kt +++ b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/diagnosticFileAnnotationInWrongPlace.kt @@ -1,3 +1,4 @@ +// COMPARE_WITH_LIGHT_TREE package bar @file:foo @@ -17,4 +18,4 @@ interface T annotation class foo annotation class bar -annotation class baz \ No newline at end of file +annotation class baz diff --git a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/diagnosticWithoutPackage.fir.kt b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/diagnosticWithoutPackage.fir.kt index 1749fa5e321..ab57c9d9783 100644 --- a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/diagnosticWithoutPackage.fir.kt +++ b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/diagnosticWithoutPackage.fir.kt @@ -1,3 +1,4 @@ +// COMPARE_WITH_LIGHT_TREE @file:foo @foo @bar @file:[baz] @@ -5,4 +6,4 @@ fun test() {} annotation class foo annotation class bar -annotation class baz \ No newline at end of file +annotation class baz diff --git a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/diagnosticWithoutPackage.kt b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/diagnosticWithoutPackage.kt index 8ce502184be..07e66ebf7c3 100644 --- a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/diagnosticWithoutPackage.kt +++ b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/diagnosticWithoutPackage.kt @@ -1,3 +1,4 @@ +// COMPARE_WITH_LIGHT_TREE @file:foo @foo @bar @file:[baz] @@ -5,4 +6,4 @@ fun test() {} annotation class foo annotation class bar -annotation class baz \ No newline at end of file +annotation class baz diff --git a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/checkBackingFieldException.fir.kt b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/checkBackingFieldException.fir.kt index 40263a0ae6e..4e3c602719e 100644 --- a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/checkBackingFieldException.fir.kt +++ b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/checkBackingFieldException.fir.kt @@ -1,3 +1,4 @@ +// COMPARE_WITH_LIGHT_TREE package h class Square() { diff --git a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/checkBackingFieldException.kt b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/checkBackingFieldException.kt index 68d19fae4e4..79998a926b1 100644 --- a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/checkBackingFieldException.kt +++ b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/checkBackingFieldException.kt @@ -1,3 +1,4 @@ +// COMPARE_WITH_LIGHT_TREE package h class Square() { diff --git a/compiler/testData/diagnostics/tests/kt435.fir.kt b/compiler/testData/diagnostics/tests/kt435.fir.kt index 7830a5ae3fa..6634c3633d6 100644 --- a/compiler/testData/diagnostics/tests/kt435.fir.kt +++ b/compiler/testData/diagnostics/tests/kt435.fir.kt @@ -1,3 +1,4 @@ +// COMPARE_WITH_LIGHT_TREE fun Any.foo1() : (i : Int) -> Unit { return {} } diff --git a/compiler/testData/diagnostics/tests/kt435.kt b/compiler/testData/diagnostics/tests/kt435.kt index cc0edcb6c0d..04121f0ab04 100644 --- a/compiler/testData/diagnostics/tests/kt435.kt +++ b/compiler/testData/diagnostics/tests/kt435.kt @@ -1,7 +1,8 @@ +// COMPARE_WITH_LIGHT_TREE fun Any.foo1() : (i : Int) -> Unit { return {} } fun test(a : Any) { a.foo1()() -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/objects/Objects.fir.kt b/compiler/testData/diagnostics/tests/objects/Objects.fir.kt index 30c1aa71943..87f125e4a1f 100644 --- a/compiler/testData/diagnostics/tests/objects/Objects.fir.kt +++ b/compiler/testData/diagnostics/tests/objects/Objects.fir.kt @@ -1,3 +1,4 @@ +// COMPARE_WITH_LIGHT_TREE package toplevelObjectDeclarations open class Foo(y : Int) { diff --git a/compiler/testData/diagnostics/tests/objects/Objects.kt b/compiler/testData/diagnostics/tests/objects/Objects.kt index 89814c40002..ba346f1d738 100644 --- a/compiler/testData/diagnostics/tests/objects/Objects.kt +++ b/compiler/testData/diagnostics/tests/objects/Objects.kt @@ -1,3 +1,4 @@ +// COMPARE_WITH_LIGHT_TREE package toplevelObjectDeclarations open class Foo(y : Int) { diff --git a/compiler/testData/diagnostics/tests/regressions/kt328.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt328.fir.kt index a7afe21070a..566fd637ba5 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt328.fir.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt328.fir.kt @@ -1,3 +1,4 @@ +// COMPARE_WITH_LIGHT_TREE // !WITH_NEW_INFERENCE //KT-328 Local function in function literals cause exceptions diff --git a/compiler/testData/diagnostics/tests/regressions/kt328.kt b/compiler/testData/diagnostics/tests/regressions/kt328.kt index dd94b10c7a0..92c0521be4a 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt328.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt328.kt @@ -1,3 +1,4 @@ +// COMPARE_WITH_LIGHT_TREE // !WITH_NEW_INFERENCE //KT-328 Local function in function literals cause exceptions diff --git a/compiler/testData/diagnostics/tests/resolve/nestedCalls/kt5971NestedSafeCall.fir.kt b/compiler/testData/diagnostics/tests/resolve/nestedCalls/kt5971NestedSafeCall.fir.kt index 45c85854fd5..8e8a35fc8fb 100644 --- a/compiler/testData/diagnostics/tests/resolve/nestedCalls/kt5971NestedSafeCall.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/nestedCalls/kt5971NestedSafeCall.fir.kt @@ -1,3 +1,4 @@ +// COMPARE_WITH_LIGHT_TREE // !DIAGNOSTICS: -UNUSED_PARAMETER //KT-5971 Missing error when fun argument is safe call diff --git a/compiler/testData/diagnostics/tests/resolve/nestedCalls/kt5971NestedSafeCall.kt b/compiler/testData/diagnostics/tests/resolve/nestedCalls/kt5971NestedSafeCall.kt index 33850f62a61..c4299bdf630 100644 --- a/compiler/testData/diagnostics/tests/resolve/nestedCalls/kt5971NestedSafeCall.kt +++ b/compiler/testData/diagnostics/tests/resolve/nestedCalls/kt5971NestedSafeCall.kt @@ -1,3 +1,4 @@ +// COMPARE_WITH_LIGHT_TREE // !DIAGNOSTICS: -UNUSED_PARAMETER //KT-5971 Missing error when fun argument is safe call diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/AbstractFirDiagnosticTest.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/AbstractFirDiagnosticTest.kt index 7ac1bea500a..575a41cd9be 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/AbstractFirDiagnosticTest.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/AbstractFirDiagnosticTest.kt @@ -73,10 +73,6 @@ fun TestConfigurationBuilder.baseFirDiagnosticTestConfiguration() { useMetaInfoProcessors(::PsiLightTreeMetaInfoProcessor) - defaultDirectives { - +COMPARE_WITH_LIGHT_TREE - } - forTestsMatching("compiler/testData/diagnostics/*") { useAfterAnalysisCheckers( ::FirIdenticalChecker, diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/68.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/68.fir.kt index 09c79cabad4..8e5c36ba0e3 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/68.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/68.fir.kt @@ -1,5 +1,6 @@ // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_EXPRESSION +// COMPARE_WITH_LIGHT_TREE // SKIP_TXT // TESTCASE NUMBER: 1 diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/68.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/68.kt index c169e1777e1..a45b4f355bb 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/68.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/68.kt @@ -1,5 +1,6 @@ // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_EXPRESSION +// COMPARE_WITH_LIGHT_TREE // SKIP_TXT /* @@ -73,4 +74,4 @@ fun case_8(x: Any?) { x x.length } -} \ No newline at end of file +}