From fcc6f873c72328bf8dbfd978aede3cda8b7d18c9 Mon Sep 17 00:00:00 2001 From: Roman Efremov Date: Fri, 20 Oct 2023 18:28:41 +0200 Subject: [PATCH] [FIR] Prevent reporting ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT twice in CLI It is duplicated because we have two checkers: FIR (for IDE support in simple cases) and IR ("honest" checker supporting all cases). Fix this by running FIR checker only in IDE. FIR checker behavior remains covered by tests in `LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated`. ^KT-62559 Fixed --- .../AbstractFirIdeDiagnosticsCollector.kt | 1 + .../checkers/CommonDeclarationCheckers.kt | 1 - .../CommonIdeOnlyDeclarationCheckers.kt | 18 ++++++++++ .../FirActualAnnotationsMatchExpectChecker.kt | 4 ++- .../actualInnerClassMissingMember.fir.kt | 2 +- .../annotationArgRendering.fir.kt | 6 ++-- .../annotationArgumentsDefaults.fir.kt | 2 +- .../annotationArgumentsWithLazyResolve.fir.kt | 6 ++-- .../annotationTypeParameters.fir.kt | 12 +++---- .../basicOnDeclaration.fir.kt | 4 +-- .../checkDiagnosticFullText.fir.kt | 18 +++++----- .../classScopeInnerClasses.fir.kt | 2 +- .../classScopeViaTypealiasIncompatible.fir.kt | 5 ++- .../classScopeViaTypealiasIncompatible.kt | 1 - .../classScopeViaTypealiasIncompatible.ll.kt | 1 - .../compatibleOverrides.fir.kt | 2 +- .../defaultValueParametersRendering.fir.kt | 2 +- .../enumEntries.fir.kt | 2 +- .../fakeOverrides.fir.kt | 2 +- .../gettersAndSetters.fir.kt | 10 +++--- .../repeatableWithArg.fir.kt | 2 +- ...ceRetentionAnnotationsWhenTypealias.fir.kt | 2 +- .../substitutionOverrideInTwoClasses.fir.kt | 2 +- .../twoActualTypealiasesToSameClass.fir.kt | 2 +- .../typeParameters.fir.kt | 8 ++--- .../typeUsage.fir.kt | 34 +++++++++---------- .../typeUsageTypealiasInSuper.fir.kt | 2 +- .../typeUsageWithImplicitType.fir.kt | 2 +- .../typealias.fir.kt | 12 +++---- ...pealiasToJavaWithAnnotationArgument.fir.kt | 2 +- .../typealiasToKtLibrary.fir.kt | 2 +- .../valueParameters.fir.kt | 4 +-- .../withOtherIncomatibilities.fir.kt | 2 +- 33 files changed, 97 insertions(+), 80 deletions(-) create mode 100644 compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/CommonIdeOnlyDeclarationCheckers.kt diff --git a/analysis/low-level-api-fir/src/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostics/AbstractFirIdeDiagnosticsCollector.kt b/analysis/low-level-api-fir/src/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostics/AbstractFirIdeDiagnosticsCollector.kt index a6eecf29781..9d9d851ccbd 100644 --- a/analysis/low-level-api-fir/src/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostics/AbstractFirIdeDiagnosticsCollector.kt +++ b/analysis/low-level-api-fir/src/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostics/AbstractFirIdeDiagnosticsCollector.kt @@ -80,6 +80,7 @@ private object CheckersFactory { } else { createDeclarationCheckers { add(CommonDeclarationCheckers) + add(CommonIdeOnlyDeclarationCheckers) when { platform.isJvm() -> add(JvmDeclarationCheckers) platform.isJs() -> add(JsDeclarationCheckers) diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/CommonDeclarationCheckers.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/CommonDeclarationCheckers.kt index 4f01c44bc34..178d93723cc 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/CommonDeclarationCheckers.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/CommonDeclarationCheckers.kt @@ -29,7 +29,6 @@ object CommonDeclarationCheckers : DeclarationCheckers() { FirExposedVisibilityDeclarationChecker, FirCyclicTypeBoundsChecker, FirExpectActualDeclarationChecker, - FirActualAnnotationsMatchExpectChecker, FirAmbiguousAnonymousTypeChecker, FirExplicitApiDeclarationChecker, FirAnnotationChecker, diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/CommonIdeOnlyDeclarationCheckers.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/CommonIdeOnlyDeclarationCheckers.kt new file mode 100644 index 00000000000..652f6510b20 --- /dev/null +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/CommonIdeOnlyDeclarationCheckers.kt @@ -0,0 +1,18 @@ +/* + * Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.analysis.checkers + +import org.jetbrains.kotlin.fir.analysis.checkers.declaration.DeclarationCheckers +import org.jetbrains.kotlin.fir.analysis.checkers.declaration.FirActualAnnotationsMatchExpectChecker +import org.jetbrains.kotlin.fir.analysis.checkers.declaration.FirBasicDeclarationChecker + +/** + * Checkers, which only run in IDE and don't run in CLI mode. + */ +object CommonIdeOnlyDeclarationCheckers : DeclarationCheckers() { + override val basicDeclarationCheckers: Set + get() = setOf(FirActualAnnotationsMatchExpectChecker) +} \ No newline at end of file diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirActualAnnotationsMatchExpectChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirActualAnnotationsMatchExpectChecker.kt index 4dd760cb8c6..018f0056667 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirActualAnnotationsMatchExpectChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirActualAnnotationsMatchExpectChecker.kt @@ -21,7 +21,9 @@ import org.jetbrains.kotlin.fir.expressions.FirAnnotation import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol import org.jetbrains.kotlin.resolve.calls.mpp.AbstractExpectActualAnnotationMatchChecker -// TODO(Roman.Efremov): KT-62559 prevent reporting ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT twice in CLI mode in K2 +/** + * This checker runs only in IDE mode. In CLI IR checker runs instead of it. + */ internal object FirActualAnnotationsMatchExpectChecker : FirBasicDeclarationChecker() { override fun check(declaration: FirDeclaration, context: CheckerContext, reporter: DiagnosticReporter) { if (declaration !is FirMemberDeclaration) return diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/actualInnerClassMissingMember.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/actualInnerClassMissingMember.fir.kt index 66d03881844..73e00eaac5a 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/actualInnerClassMissingMember.fir.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/actualInnerClassMissingMember.fir.kt @@ -18,4 +18,4 @@ class AImpl { } } -actual typealias A = AImpl +actual typealias A = AImpl diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/annotationArgRendering.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/annotationArgRendering.fir.kt index 5cca8ea1bde..2e00d32639c 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/annotationArgRendering.fir.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/annotationArgRendering.fir.kt @@ -14,9 +14,9 @@ expect fun onType(): @Ann2("") Any? // MODULE: m1-jvm()()(m1-common) // FILE: jvm.kt -actual annotation class Ann +actual annotation class Ann -actual fun stringConcat() {} +actual fun stringConcat() {} // Not reported in K1, because supported starting from K2 -actual fun onType(): Any? = null +actual fun onType(): Any? = null diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/annotationArgumentsDefaults.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/annotationArgumentsDefaults.fir.kt index be1daa3a13e..ea3fa48df09 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/annotationArgumentsDefaults.fir.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/annotationArgumentsDefaults.fir.kt @@ -8,4 +8,4 @@ expect fun explicitDefaultArgument() // FILE: jvm.kt // No special handling for this case @Ann -actual fun explicitDefaultArgument() {} +actual fun explicitDefaultArgument() {} diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/annotationArgumentsWithLazyResolve.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/annotationArgumentsWithLazyResolve.fir.kt index bad02b40532..88c2deaec14 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/annotationArgumentsWithLazyResolve.fir.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/annotationArgumentsWithLazyResolve.fir.kt @@ -21,14 +21,14 @@ expect fun withEmptyArguments_positive() // MODULE: main()()(common) // TARGET_PLATFORM: JVM actual fun onType_negative(): @Ann("") Any = Any() -actual fun onType_positive(): @Ann("incorrect") Any = Any() +actual fun onType_positive(): @Ann("incorrect") Any = Any() @Ann("") actual fun onFunction_negative() {} @Ann("incorrect") -actual fun onFunction_positive() {} +actual fun onFunction_positive() {} @Ann actual fun withEmptyArguments_negative() {} @Ann("incorrect") -actual fun withEmptyArguments_positive() {} +actual fun withEmptyArguments_positive() {} diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/annotationTypeParameters.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/annotationTypeParameters.fir.kt index a4f45fad3c5..c2181016e5c 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/annotationTypeParameters.fir.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/annotationTypeParameters.fir.kt @@ -63,25 +63,25 @@ expect fun explicitVsInfered() actual fun sameTypeParam() {} @Ann -actual fun differentTypeParam() {} +actual fun differentTypeParam() {} @Ann -actual fun differentWithSameName() {} +actual fun differentWithSameName() {} @Ann -actual fun nonNullvsNull() {} +actual fun nonNullvsNull() {} @Ann> -actual fun differentVariance() {} +actual fun differentVariance() {} @Ann> -actual fun varianceVsNoVariance() {} +actual fun varianceVsNoVariance() {} @Ann> actual fun sameVariance() {} @Ann> -actual fun startProjection() {} +actual fun startProjection() {} @ComplexNested( ComplexNested(), diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/basicOnDeclaration.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/basicOnDeclaration.fir.kt index 24b5ad2d430..8cb2c6b8960 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/basicOnDeclaration.fir.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/basicOnDeclaration.fir.kt @@ -25,7 +25,7 @@ expect class AnnotationInside { @Ann actual class AnnotationMatching -actual class AnnotationOnExpectOnly +actual class AnnotationOnExpectOnly @Ann actual class AnnotationOnActualOnly @@ -34,7 +34,7 @@ actual class AnnotationInside { @Ann actual fun matches() {} - actual fun onlyOnExpect() {} + actual fun onlyOnExpect() {} @Ann actual fun onlyOnActual() {} diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/checkDiagnosticFullText.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/checkDiagnosticFullText.fir.kt index 8afbc683967..f0cb82d293d 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/checkDiagnosticFullText.fir.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/checkDiagnosticFullText.fir.kt @@ -44,28 +44,28 @@ expect fun onType(param: @Ann Any) // MODULE: m1-jvm()()(m1-common) // FILE: jvm.kt -actual class OnClass +actual class OnClass actual class OnMember { - actual fun onMember() {} + actual fun onMember() {} } class ViaTypealiasImpl -actual typealias ViaTypealias = ViaTypealiasImpl +actual typealias ViaTypealias = ViaTypealiasImpl class MemberScopeViaTypealiasImpl { fun foo() {} } -actual typealias MemberScopeViaTypealias = MemberScopeViaTypealiasImpl +actual typealias MemberScopeViaTypealias = MemberScopeViaTypealiasImpl @WithArg("other str") -actual fun withDifferentArg() {} +actual fun withDifferentArg() {} -actual fun inValueParam(arg: String) {} +actual fun inValueParam(arg: String) {} -actual fun inTypeParam() {} +actual fun inTypeParam() {} -actual val onGetter: String = "" +actual val onGetter: String = "" -actual fun onType(param: Any) {} +actual fun onType(param: Any) {} diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/classScopeInnerClasses.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/classScopeInnerClasses.fir.kt index 6ca419d53e3..8044c221984 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/classScopeInnerClasses.fir.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/classScopeInnerClasses.fir.kt @@ -16,7 +16,7 @@ expect class A { actual class A { actual class B { actual class C { - actual fun foo() {} + actual fun foo() {} } } } diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/classScopeViaTypealiasIncompatible.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/classScopeViaTypealiasIncompatible.fir.kt index 0e2b21d8da9..094c10ddc79 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/classScopeViaTypealiasIncompatible.fir.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/classScopeViaTypealiasIncompatible.fir.kt @@ -18,11 +18,10 @@ class WeakIncompatibilityImpl { fun foo(differentName: String) {} } -// TODO: Duplicated diagnostic will be fixed in KT-62559 -actual typealias WeakIncompatibility = WeakIncompatibilityImpl +actual typealias WeakIncompatibility = WeakIncompatibilityImpl class StrongIncompatibilityImpl { fun foo(p: String) {} // Different param type } -actual typealias StrongIncompatibility = StrongIncompatibilityImpl +actual typealias StrongIncompatibility = StrongIncompatibilityImpl diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/classScopeViaTypealiasIncompatible.kt b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/classScopeViaTypealiasIncompatible.kt index c4d7ec8b6f4..9d1b6bec5af 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/classScopeViaTypealiasIncompatible.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/classScopeViaTypealiasIncompatible.kt @@ -18,7 +18,6 @@ class WeakIncompatibilityImpl { fun foo(differentName: String) {} } -// TODO: Duplicated diagnostic will be fixed in KT-62559 actual typealias WeakIncompatibility = WeakIncompatibilityImpl class StrongIncompatibilityImpl { diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/classScopeViaTypealiasIncompatible.ll.kt b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/classScopeViaTypealiasIncompatible.ll.kt index c4d7ec8b6f4..9d1b6bec5af 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/classScopeViaTypealiasIncompatible.ll.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/classScopeViaTypealiasIncompatible.ll.kt @@ -18,7 +18,6 @@ class WeakIncompatibilityImpl { fun foo(differentName: String) {} } -// TODO: Duplicated diagnostic will be fixed in KT-62559 actual typealias WeakIncompatibility = WeakIncompatibilityImpl class StrongIncompatibilityImpl { diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/compatibleOverrides.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/compatibleOverrides.fir.kt index 4f2604e7185..89d5620f6d5 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/compatibleOverrides.fir.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/compatibleOverrides.fir.kt @@ -14,5 +14,5 @@ expect class CompatibleOverrides { actual class CompatibleOverrides { actual fun foo() {} - actual fun foo(withArg: Any) {} + actual fun foo(withArg: Any) {} } diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/defaultValueParametersRendering.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/defaultValueParametersRendering.fir.kt index ec40c3c504b..c0c4f1aa208 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/defaultValueParametersRendering.fir.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/defaultValueParametersRendering.fir.kt @@ -7,4 +7,4 @@ expect fun foo(p: Array = arrayOf()) // MODULE: m1-jvm()()(m1-common) // FILE: jvm.kt -actual fun = ...): Unit; fun foo(p: Array): Unit; Annotation `@Ann()` is missing on actual declaration")!>foo(p: Array) {} +actual fun foo(p: Array) {} diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/enumEntries.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/enumEntries.fir.kt index d7fb6c9d32e..0d109b398aa 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/enumEntries.fir.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/enumEntries.fir.kt @@ -10,6 +10,6 @@ annotation class Ann // MODULE: m1-jvm()()(m1-common) // FILE: jvm.kt -actual enum class E { +actual enum class E { FOO } diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/fakeOverrides.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/fakeOverrides.fir.kt index e53379cda2d..7d5775e79c2 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/fakeOverrides.fir.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/fakeOverrides.fir.kt @@ -28,4 +28,4 @@ abstract class Intermediate : I { override fun noAnnotationOnActual() {} } -actual class FakeOverrideActual : Intermediate(), I +actual class FakeOverrideActual : Intermediate(), I diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/gettersAndSetters.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/gettersAndSetters.fir.kt index 7726ef94f3d..9bb94f1b0ec 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/gettersAndSetters.fir.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/gettersAndSetters.fir.kt @@ -23,20 +23,20 @@ expect var onSetter: String // MODULE: m1-jvm()()(m1-common) // FILE: jvm.kt -actual val onGetter: String +actual val onGetter: String get() = "" -actual val onGetterImplicit: String = "" +actual val onGetterImplicit: String = "" -actual val onGetterWithExplicitTarget: String +actual val onGetterWithExplicitTarget: String get() = "" actual val explicitTargetMatchesWithoutTarget: String @Ann get() = "" @Ann -actual val setOnPropertyWithoutTargetNotMatch: String = "" +actual val setOnPropertyWithoutTargetNotMatch: String = "" -actual var onSetter: String +actual var onSetter: String get() = "" set(_) {} diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/repeatableWithArg.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/repeatableWithArg.fir.kt index 5f385812990..70a140421e9 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/repeatableWithArg.fir.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/repeatableWithArg.fir.kt @@ -29,7 +29,7 @@ actual fun diffentOrder() {} @AnnWithArg(s = "1") @AnnWithArg(s = "3") -actual fun withDifferentArgLessOnActual() {} +actual fun withDifferentArgLessOnActual() {} @AnnWithArg(s = "1") @AnnWithArg(s = "2") diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/sourceRetentionAnnotationsWhenTypealias.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/sourceRetentionAnnotationsWhenTypealias.fir.kt index d55ccc08beb..dc36962660a 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/sourceRetentionAnnotationsWhenTypealias.fir.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/sourceRetentionAnnotationsWhenTypealias.fir.kt @@ -20,6 +20,6 @@ class SourceAvailableImpl { fun foo() {} } -actual typealias SourceAvailable = SourceAvailableImpl +actual typealias SourceAvailable = SourceAvailableImpl actual typealias FromLib = kotlin.SinceKotlin diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/substitutionOverrideInTwoClasses.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/substitutionOverrideInTwoClasses.fir.kt index 9dce5ad1acd..18de9faee90 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/substitutionOverrideInTwoClasses.fir.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/substitutionOverrideInTwoClasses.fir.kt @@ -19,6 +19,6 @@ abstract class Parent { abstract class Intermediate : Parent() -actual class WithAnn : Intermediate() +actual class WithAnn : Intermediate() actual class WithoutAnn : Intermediate() diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/twoActualTypealiasesToSameClass.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/twoActualTypealiasesToSameClass.fir.kt index fd9c26265db..2c16a55872a 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/twoActualTypealiasesToSameClass.fir.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/twoActualTypealiasesToSameClass.fir.kt @@ -17,5 +17,5 @@ class Impl { fun foo() {} } -actual typealias WithAnn = Impl +actual typealias WithAnn = Impl actual typealias WithoutAnn = Impl diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/typeParameters.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/typeParameters.fir.kt index 19ca74cabb2..7dbbbd87fb6 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/typeParameters.fir.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/typeParameters.fir.kt @@ -17,11 +17,11 @@ expect class TypealiasParamNotAccepted<@Ann A> // MODULE: m1-jvm()()(m1-common) // FILE: jvm.kt -actual fun inMethod() {} +actual fun inMethod() {} -actual fun <@Ann A, B> inMethodTwoParams() {} +actual fun <@Ann A, B> inMethodTwoParams() {} -actual class InClass +actual class InClass class ViaTypealiasImpl<@Ann A> @@ -29,6 +29,6 @@ actual typealias ViaTypealias = ViaTypealiasImpl class TypealiasParamNotAcceptedImpl -actual typealias TypealiasParamNotAccepted<@Ann A> = TypealiasParamNotAcceptedImpl +actual typealias TypealiasParamNotAccepted<@Ann A> = TypealiasParamNotAcceptedImpl actual fun withIncompatibility() {} diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/typeUsage.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/typeUsage.fir.kt index a0c748ce2ca..824e2836d5c 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/typeUsage.fir.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/typeUsage.fir.kt @@ -61,46 +61,46 @@ expect fun funcTypeArgType(arg: (arg: @Ann Any) -> Unit) // MODULE: m1-jvm()()(m1-common) // FILE: jvm.kt -actual fun valueParameterType(arg: String) {} +actual fun valueParameterType(arg: String) {} -actual fun returnType(): String = "" +actual fun returnType(): String = "" -actual fun methodTypeParamBound() {} +actual fun methodTypeParamBound() {} -actual class OnClassTypeParamBound +actual class OnClassTypeParamBound -actual fun typeParamBoundInWhere() where T : Any {} +actual fun typeParamBoundInWhere() where T : Any {} -actual fun severalBounds() where T : I1, T : I2 {} +actual fun severalBounds() where T : I1, T : I2 {} actual fun severalBoundsDifferentOrder() where T : @Ann I1, T : I2 {} actual fun lessTypeParamBoundsOnActual() where T : @Ann I2 {} -actual fun Any.onReceiver() {} +actual fun Any.onReceiver() {} -actual class OnClassSuper : I1 +actual class OnClassSuper : I1 actual class OnClassSuperDifferentOrder : @Ann I2, I1 -actual class OnClassSuperMoreOnActual : I1, I2 +actual class OnClassSuperMoreOnActual : I1, I2 -actual class OnClassSuperTypeParams : I3 +actual class OnClassSuperTypeParams : I3 -actual fun deepInParamsTypes(arg: I3>) {} +actual fun deepInParamsTypes(arg: I3>) {} -actual fun starProjection(arg: I4<*, Any>) {} +actual fun starProjection(arg: I4<*, Any>) {} -actual fun typeArgWithVariance(t: I3) {} +actual fun typeArgWithVariance(t: I3) {} actual fun qualifierPartsMatching(arg: WithNested.Nested<@Ann String>) {} -actual fun qualifierPartsNonMatching(arg: WithNested<@Ann String>.Nested) {} +actual fun qualifierPartsNonMatching(arg: WithNested<@Ann String>.Nested) {} actual fun funTypeVsUserType(arg: kotlin.jvm.functions.Function0) {} -actual fun funcTypeReturnType(arg: () -> Any) {} +actual fun funcTypeReturnType(arg: () -> Any) {} -actual fun funcTypeReceiverType(arg: Any.() -> Unit) {} +actual fun funcTypeReceiverType(arg: Any.() -> Unit) {} -actual fun funcTypeArgType(arg: (arg: Any) -> Unit) {} +actual fun funcTypeArgType(arg: (arg: Any) -> Unit) {} diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/typeUsageTypealiasInSuper.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/typeUsageTypealiasInSuper.fir.kt index 283e777561c..4f69576170d 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/typeUsageTypealiasInSuper.fir.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/typeUsageTypealiasInSuper.fir.kt @@ -11,4 +11,4 @@ expect class Foo: @Ann I // FILE: jvm.kt typealias ITypealias = I -actual class Foo : ITypealias +actual class Foo : ITypealias diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/typeUsageWithImplicitType.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/typeUsageWithImplicitType.fir.kt index d244739065e..ce153a466a8 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/typeUsageWithImplicitType.fir.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/typeUsageWithImplicitType.fir.kt @@ -7,4 +7,4 @@ expect fun foo(): @Ann Int // MODULE: m1-jvm()()(m1-common) // FILE: jvm.kt -actual fun foo() = 1 +actual fun foo() = 1 diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/typealias.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/typealias.fir.kt index 0ed804dfefe..50176cbec86 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/typealias.fir.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/typealias.fir.kt @@ -48,28 +48,28 @@ expect class InnerClassInsideTypealias { // FILE: jvm.kt class KtTypealiasNotMatchImpl -actual typealias KtTypealiasNotMatch = KtTypealiasNotMatchImpl +actual typealias KtTypealiasNotMatch = KtTypealiasNotMatchImpl class AnnotationsNotConsideredOnTypealiasImpl @Ann -actual typealias AnnotationsNotConsideredOnTypealias = AnnotationsNotConsideredOnTypealiasImpl +actual typealias AnnotationsNotConsideredOnTypealias = AnnotationsNotConsideredOnTypealiasImpl class MethodsInsideTypealiasImpl { fun foo() {} } -actual typealias MethodsInsideTypealias = MethodsInsideTypealiasImpl +actual typealias MethodsInsideTypealias = MethodsInsideTypealiasImpl class ValueInsideTypealiasImpl { val value: String = "" } -actual typealias ValueInsideTypealias = ValueInsideTypealiasImpl +actual typealias ValueInsideTypealias = ValueInsideTypealiasImpl class ConstructorInsideTypealiasImpl -actual typealias ConstructorInsideTypealias = ConstructorInsideTypealiasImpl +actual typealias ConstructorInsideTypealias = ConstructorInsideTypealiasImpl class MethodWithComplexAnnInsideTypealiasImpl { @ComplexAnn("13") @@ -84,4 +84,4 @@ class InnerClassInsideTypealiasImpl { } } -actual typealias InnerClassInsideTypealias = InnerClassInsideTypealiasImpl +actual typealias InnerClassInsideTypealias = InnerClassInsideTypealiasImpl diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/typealiasToJavaWithAnnotationArgument.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/typealiasToJavaWithAnnotationArgument.fir.kt index 22ab5dd7bc4..4863fe7c5b9 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/typealiasToJavaWithAnnotationArgument.fir.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/typealiasToJavaWithAnnotationArgument.fir.kt @@ -11,7 +11,7 @@ expect class Foo // FILE: Foo.kt actual annotation class Ann actual constructor(actual val p: Int) -actual typealias Foo = FooImpl +actual typealias Foo = FooImpl // FILE: FooImpl.java @Ann(p = 2) diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/typealiasToKtLibrary.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/typealiasToKtLibrary.fir.kt index 2a47de49a2d..2f8bd6d93a9 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/typealiasToKtLibrary.fir.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/typealiasToKtLibrary.fir.kt @@ -40,4 +40,4 @@ expect abstract class MyAbstractIterator { actual typealias MyDeprecatedMatch = kotlin.Deprecated -actual typealias MyAbstractIterator = AbstractIterator +actual typealias MyAbstractIterator = AbstractIterator diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/valueParameters.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/valueParameters.fir.kt index d7c5cc481eb..b7dfb4b9eeb 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/valueParameters.fir.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/valueParameters.fir.kt @@ -11,8 +11,8 @@ expect class InConstructor(@Ann arg: String) // MODULE: m1-jvm()()(m1-common) // FILE: jvm.kt -actual fun inMethod(arg: String) {} +actual fun inMethod(arg: String) {} -actual class InConstructor actual constructor(arg: String) {} +actual class InConstructor actual constructor(arg: String) {} actual fun withIncopatibility(p1: String) {} diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/withOtherIncomatibilities.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/withOtherIncomatibilities.fir.kt index 8848a429978..7a3251c4180 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/withOtherIncomatibilities.fir.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/withOtherIncomatibilities.fir.kt @@ -12,7 +12,7 @@ expect fun hasStrongIncompatibility(arg: Double) // MODULE: m1-jvm()()(m1-common) // FILE: jvm.kt -actual fun hasWeakIncompatibility() {} +actual fun hasWeakIncompatibility() {} actual fun hasStrongIncompatibility(arg: Any?) {}