From a42e9c236a2588977405101c33359bd72ae29c2f Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Wed, 9 Jun 2021 14:04:41 +0300 Subject: [PATCH] [FIR] Fix PSI types of some diagnostics --- .../diagnostics/FirDiagnosticsList.kt | 45 +++++++++--------- .../fir/analysis/diagnostics/FirErrors.kt | 47 +++++++++---------- .../FirAnnotationArgumentChecker.kt | 2 +- ...gleArrayElementAsVarargInAnnotation.fir.kt | 10 ++-- ...rayElementAsVarargInAnnotationError.fir.kt | 10 ++-- .../diagnostics/KtFirDataClassConverters.kt | 5 +- .../api/fir/diagnostics/KtFirDiagnostics.kt | 47 +++++++++---------- .../fir/diagnostics/KtFirDiagnosticsImpl.kt | 47 +++++++++---------- 8 files changed, 102 insertions(+), 111 deletions(-) diff --git a/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/diagnostics/FirDiagnosticsList.kt b/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/diagnostics/FirDiagnosticsList.kt index e2276c7d155..8a561cd8409 100644 --- a/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/diagnostics/FirDiagnosticsList.kt +++ b/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/diagnostics/FirDiagnosticsList.kt @@ -178,7 +178,7 @@ object DIAGNOSTICS_LIST : DiagnosticList("FirErrors") { val NULLABLE_TYPE_OF_ANNOTATION_MEMBER by error() val VAR_ANNOTATION_PARAMETER by error(PositioningStrategy.VAL_OR_VAR_NODE) val SUPERTYPES_FOR_ANNOTATION_CLASS by error(PositioningStrategy.SUPERTYPES_LIST) - val ANNOTATION_USED_AS_ANNOTATION_ARGUMENT by error() + val ANNOTATION_USED_AS_ANNOTATION_ARGUMENT by error() val ILLEGAL_KOTLIN_VERSION_STRING_VALUE by error() val NEWER_VERSION_IN_SINCE_KOTLIN by warning { parameter("specifiedVersion") @@ -342,7 +342,8 @@ object DIAGNOSTICS_LIST : DiagnosticList("FirErrors") { parameter("reason") } - val VARARG_OUTSIDE_PARENTHESES by error() + // TODO: reset to KtExpression after fixsing lambda argument sources + val VARARG_OUTSIDE_PARENTHESES by error() val NAMED_ARGUMENTS_NOT_ALLOWED by error(PositioningStrategy.NAME_OF_NAMED_ARGUMENT) { parameter("forbiddenNamedArgumentsTarget") @@ -415,13 +416,13 @@ object DIAGNOSTICS_LIST : DiagnosticList("FirErrors") { val TYPE_PARAMETERS_IN_OBJECT by error() val ILLEGAL_PROJECTION_USAGE by error() val TYPE_PARAMETERS_IN_ENUM by error() - val CONFLICTING_PROJECTION by error(PositioningStrategy.VARIANCE_MODIFIER) { + val CONFLICTING_PROJECTION by error(PositioningStrategy.VARIANCE_MODIFIER) { parameter("type") } - val CONFLICTING_PROJECTION_IN_TYPEALIAS_EXPANSION by error(PositioningStrategy.VARIANCE_MODIFIER) { + val CONFLICTING_PROJECTION_IN_TYPEALIAS_EXPANSION by error(PositioningStrategy.VARIANCE_MODIFIER) { parameter("type") } - val REDUNDANT_PROJECTION by warning(PositioningStrategy.VARIANCE_MODIFIER) { + val REDUNDANT_PROJECTION by warning(PositioningStrategy.VARIANCE_MODIFIER) { parameter("type") } val VARIANCE_ON_TYPE_PARAMETER_NOT_ALLOWED by error(PositioningStrategy.VARIANCE_MODIFIER) @@ -429,7 +430,7 @@ object DIAGNOSTICS_LIST : DiagnosticList("FirErrors") { val CATCH_PARAMETER_WITH_DEFAULT_VALUE by error() val REIFIED_TYPE_IN_CATCH_CLAUSE by error() val TYPE_PARAMETER_IN_CATCH_CLAUSE by error() - val GENERIC_THROWABLE_SUBCLASS by error() + val GENERIC_THROWABLE_SUBCLASS by error() val INNER_CLASS_OF_GENERIC_THROWABLE_SUBCLASS by error(PositioningStrategy.DECLARATION_NAME) val KCLASS_WITH_NULLABLE_TYPE_PARAMETER_IN_SIGNATURE by error(PositioningStrategy.DECLARATION_NAME) { @@ -656,7 +657,9 @@ object DIAGNOSTICS_LIST : DiagnosticList("FirErrors") { parameter("varargParameterType") } val VALUE_PARAMETER_WITH_NO_TYPE_ANNOTATION by error() - val CANNOT_INFER_PARAMETER_TYPE by error() + + // TODO: replace with KtParameter + val CANNOT_INFER_PARAMETER_TYPE by error() } val FUN_INTERFACES by object : DiagnosticGroup("Fun interfaces") { @@ -688,8 +691,8 @@ object DIAGNOSTICS_LIST : DiagnosticList("FirErrors") { val EXTENSION_PROPERTY_WITH_BACKING_FIELD by error() val PROPERTY_INITIALIZER_NO_BACKING_FIELD by error() - val ABSTRACT_DELEGATED_PROPERTY by error() - val DELEGATED_PROPERTY_IN_INTERFACE by error() + val ABSTRACT_DELEGATED_PROPERTY by error() + val DELEGATED_PROPERTY_IN_INTERFACE by error() // TODO: val ACCESSOR_FOR_DELEGATED_PROPERTY by error1() val ABSTRACT_PROPERTY_WITH_GETTER by error() @@ -698,9 +701,9 @@ object DIAGNOSTICS_LIST : DiagnosticList("FirErrors") { val PRIVATE_SETTER_FOR_OPEN_PROPERTY by error(PositioningStrategy.PRIVATE_MODIFIER) val EXPECTED_PRIVATE_DECLARATION by error(PositioningStrategy.VISIBILITY_MODIFIER) val VAL_WITH_SETTER by error() - val CONST_VAL_NOT_TOP_LEVEL_OR_OBJECT by error(PositioningStrategy.CONST_MODIFIER) - val CONST_VAL_WITH_GETTER by error() - val CONST_VAL_WITH_DELEGATE by error() + val CONST_VAL_NOT_TOP_LEVEL_OR_OBJECT by error(PositioningStrategy.CONST_MODIFIER) + val CONST_VAL_WITH_GETTER by error() + val CONST_VAL_WITH_DELEGATE by error() val TYPE_CANT_BE_USED_FOR_CONST_VAL by error(PositioningStrategy.CONST_MODIFIER) { parameter("constValType") } @@ -729,7 +732,7 @@ object DIAGNOSTICS_LIST : DiagnosticList("FirErrors") { val EXPECTED_PROPERTY_INITIALIZER by error() // TODO: need to cover `by` as well as delegate expression - val EXPECTED_DELEGATED_PROPERTY by error() + val EXPECTED_DELEGATED_PROPERTY by error() val EXPECTED_LATEINIT_PROPERTY by error(PositioningStrategy.LATEINIT_MODIFIER) } @@ -891,8 +894,8 @@ object DIAGNOSTICS_LIST : DiagnosticList("FirErrors") { parameter("actualType") } - val UNDERSCORE_IS_RESERVED by error(PositioningStrategy.RESERVED_UNDERSCORE) - val UNDERSCORE_USAGE_WITHOUT_BACKTICKS by error(PositioningStrategy.RESERVED_UNDERSCORE) + val UNDERSCORE_IS_RESERVED by error(PositioningStrategy.RESERVED_UNDERSCORE) + val UNDERSCORE_USAGE_WITHOUT_BACKTICKS by error(PositioningStrategy.RESERVED_UNDERSCORE) val EQUALITY_NOT_APPLICABLE by error { parameter("operator") @@ -912,13 +915,13 @@ object DIAGNOSTICS_LIST : DiagnosticList("FirErrors") { val TYPE_ALIAS by object : DiagnosticGroup("Type alias") { val TOPLEVEL_TYPEALIASES_ONLY by error() - val RECURSIVE_TYPEALIAS_EXPANSION by error() + val RECURSIVE_TYPEALIAS_EXPANSION by error() } val EXTENDED_CHECKERS by object : DiagnosticGroup("Extended checkers") { val REDUNDANT_VISIBILITY_MODIFIER by warning(PositioningStrategy.VISIBILITY_MODIFIER) val REDUNDANT_MODALITY_MODIFIER by warning(PositioningStrategy.MODALITY_MODIFIER) - val REDUNDANT_RETURN_UNIT_TYPE by warning() + val REDUNDANT_RETURN_UNIT_TYPE by warning() val REDUNDANT_EXPLICIT_TYPE by warning() val REDUNDANT_SINGLE_EXPRESSION_STRING_TEMPLATE by warning() val CAN_BE_VAL by warning(PositioningStrategy.VAL_OR_VAR_NODE) @@ -983,13 +986,13 @@ object DIAGNOSTICS_LIST : DiagnosticList("FirErrors") { } val IMPORTS by object : DiagnosticGroup("Imports") { - val CANNOT_ALL_UNDER_IMPORT_FROM_SINGLETON by error(PositioningStrategy.IMPORT_LAST_NAME) { + val CANNOT_ALL_UNDER_IMPORT_FROM_SINGLETON by error(PositioningStrategy.IMPORT_LAST_NAME) { parameter("objectName") } - val PACKAGE_CANNOT_BE_IMPORTED by error(PositioningStrategy.IMPORT_LAST_NAME) + val PACKAGE_CANNOT_BE_IMPORTED by error(PositioningStrategy.IMPORT_LAST_NAME) - val CANNOT_BE_IMPORTED by error(PositioningStrategy.IMPORT_LAST_NAME) { + val CANNOT_BE_IMPORTED by error(PositioningStrategy.IMPORT_LAST_NAME) { parameter("name") } @@ -997,7 +1000,7 @@ object DIAGNOSTICS_LIST : DiagnosticList("FirErrors") { parameter("name") } - val OPERATOR_RENAMED_ON_IMPORT by error(PositioningStrategy.IMPORT_LAST_NAME) + val OPERATOR_RENAMED_ON_IMPORT by error(PositioningStrategy.IMPORT_LAST_NAME) } } diff --git a/compiler/fir/checkers/gen/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt b/compiler/fir/checkers/gen/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt index 0c2699103c4..3e404736cdf 100644 --- a/compiler/fir/checkers/gen/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt +++ b/compiler/fir/checkers/gen/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt @@ -6,7 +6,6 @@ package org.jetbrains.kotlin.fir.analysis.diagnostics import com.intellij.psi.PsiElement -import com.intellij.psi.PsiTypeElement import com.intellij.psi.impl.source.tree.LeafPsiElement import org.jetbrains.kotlin.config.LanguageFeature import org.jetbrains.kotlin.config.LanguageVersionSettings @@ -36,7 +35,6 @@ import org.jetbrains.kotlin.lexer.KtKeywordToken import org.jetbrains.kotlin.lexer.KtModifierKeywordToken import org.jetbrains.kotlin.name.FqName import org.jetbrains.kotlin.name.Name -import org.jetbrains.kotlin.psi.KtAnnotation import org.jetbrains.kotlin.psi.KtAnnotationEntry import org.jetbrains.kotlin.psi.KtArrayAccessExpression import org.jetbrains.kotlin.psi.KtBinaryExpression @@ -58,12 +56,11 @@ import org.jetbrains.kotlin.psi.KtParameter import org.jetbrains.kotlin.psi.KtPrimaryConstructor import org.jetbrains.kotlin.psi.KtProperty import org.jetbrains.kotlin.psi.KtPropertyAccessor -import org.jetbrains.kotlin.psi.KtPropertyDelegate import org.jetbrains.kotlin.psi.KtReturnExpression import org.jetbrains.kotlin.psi.KtSimpleNameExpression import org.jetbrains.kotlin.psi.KtTypeAlias import org.jetbrains.kotlin.psi.KtTypeParameter -import org.jetbrains.kotlin.psi.KtTypeParameterList +import org.jetbrains.kotlin.psi.KtTypeProjection import org.jetbrains.kotlin.psi.KtTypeReference import org.jetbrains.kotlin.psi.KtValueArgument import org.jetbrains.kotlin.psi.KtWhenEntry @@ -181,7 +178,7 @@ object FirErrors { val NULLABLE_TYPE_OF_ANNOTATION_MEMBER by error0() val VAR_ANNOTATION_PARAMETER by error0(SourceElementPositioningStrategies.VAL_OR_VAR_NODE) val SUPERTYPES_FOR_ANNOTATION_CLASS by error0(SourceElementPositioningStrategies.SUPERTYPES_LIST) - val ANNOTATION_USED_AS_ANNOTATION_ARGUMENT by error0() + val ANNOTATION_USED_AS_ANNOTATION_ARGUMENT by error0() val ILLEGAL_KOTLIN_VERSION_STRING_VALUE by error0() val NEWER_VERSION_IN_SINCE_KOTLIN by warning1() val DEPRECATED_SINCE_KOTLIN_WITH_UNORDERED_VERSIONS by error0() @@ -262,7 +259,7 @@ object FirErrors { val ARGUMENT_TYPE_MISMATCH by error3() val NULL_FOR_NONNULL_TYPE by error0() val INAPPLICABLE_LATEINIT_MODIFIER by error1(SourceElementPositioningStrategies.LATEINIT_MODIFIER) - val VARARG_OUTSIDE_PARENTHESES by error0() + val VARARG_OUTSIDE_PARENTHESES by error0() val NAMED_ARGUMENTS_NOT_ALLOWED by error1(SourceElementPositioningStrategies.NAME_OF_NAMED_ARGUMENT) val NON_VARARG_SPREAD by error0() val ARGUMENT_PASSED_TWICE by error0(SourceElementPositioningStrategies.NAME_OF_NAMED_ARGUMENT) @@ -292,14 +289,14 @@ object FirErrors { val TYPE_PARAMETERS_IN_OBJECT by error0() val ILLEGAL_PROJECTION_USAGE by error0() val TYPE_PARAMETERS_IN_ENUM by error0() - val CONFLICTING_PROJECTION by error1(SourceElementPositioningStrategies.VARIANCE_MODIFIER) - val CONFLICTING_PROJECTION_IN_TYPEALIAS_EXPANSION by error1(SourceElementPositioningStrategies.VARIANCE_MODIFIER) - val REDUNDANT_PROJECTION by warning1(SourceElementPositioningStrategies.VARIANCE_MODIFIER) + val CONFLICTING_PROJECTION by error1(SourceElementPositioningStrategies.VARIANCE_MODIFIER) + val CONFLICTING_PROJECTION_IN_TYPEALIAS_EXPANSION by error1(SourceElementPositioningStrategies.VARIANCE_MODIFIER) + val REDUNDANT_PROJECTION by warning1(SourceElementPositioningStrategies.VARIANCE_MODIFIER) val VARIANCE_ON_TYPE_PARAMETER_NOT_ALLOWED by error0(SourceElementPositioningStrategies.VARIANCE_MODIFIER) val CATCH_PARAMETER_WITH_DEFAULT_VALUE by error0() val REIFIED_TYPE_IN_CATCH_CLAUSE by error0() val TYPE_PARAMETER_IN_CATCH_CLAUSE by error0() - val GENERIC_THROWABLE_SUBCLASS by error0() + val GENERIC_THROWABLE_SUBCLASS by error0() val INNER_CLASS_OF_GENERIC_THROWABLE_SUBCLASS by error0(SourceElementPositioningStrategies.DECLARATION_NAME) val KCLASS_WITH_NULLABLE_TYPE_PARAMETER_IN_SIGNATURE by error1(SourceElementPositioningStrategies.DECLARATION_NAME) val TYPE_PARAMETER_AS_REIFIED by error1() @@ -377,7 +374,7 @@ object FirErrors { val MULTIPLE_VARARG_PARAMETERS by error0(SourceElementPositioningStrategies.PARAMETER_VARARG_MODIFIER) val FORBIDDEN_VARARG_PARAMETER_TYPE by error1(SourceElementPositioningStrategies.PARAMETER_VARARG_MODIFIER) val VALUE_PARAMETER_WITH_NO_TYPE_ANNOTATION by error0() - val CANNOT_INFER_PARAMETER_TYPE by error0() + val CANNOT_INFER_PARAMETER_TYPE by error0() // Fun interfaces val FUN_INTERFACE_CONSTRUCTOR_REFERENCE by error0(SourceElementPositioningStrategies.REFERENCE_BY_QUALIFIED) @@ -400,17 +397,17 @@ object FirErrors { val BACKING_FIELD_IN_INTERFACE by error0(SourceElementPositioningStrategies.DECLARATION_SIGNATURE) val EXTENSION_PROPERTY_WITH_BACKING_FIELD by error0() val PROPERTY_INITIALIZER_NO_BACKING_FIELD by error0() - val ABSTRACT_DELEGATED_PROPERTY by error0() - val DELEGATED_PROPERTY_IN_INTERFACE by error0() + val ABSTRACT_DELEGATED_PROPERTY by error0() + val DELEGATED_PROPERTY_IN_INTERFACE by error0() val ABSTRACT_PROPERTY_WITH_GETTER by error0() val ABSTRACT_PROPERTY_WITH_SETTER by error0() val PRIVATE_SETTER_FOR_ABSTRACT_PROPERTY by error0(SourceElementPositioningStrategies.PRIVATE_MODIFIER) val PRIVATE_SETTER_FOR_OPEN_PROPERTY by error0(SourceElementPositioningStrategies.PRIVATE_MODIFIER) val EXPECTED_PRIVATE_DECLARATION by error0(SourceElementPositioningStrategies.VISIBILITY_MODIFIER) val VAL_WITH_SETTER by error0() - val CONST_VAL_NOT_TOP_LEVEL_OR_OBJECT by error0(SourceElementPositioningStrategies.CONST_MODIFIER) - val CONST_VAL_WITH_GETTER by error0() - val CONST_VAL_WITH_DELEGATE by error0() + val CONST_VAL_NOT_TOP_LEVEL_OR_OBJECT by error0(SourceElementPositioningStrategies.CONST_MODIFIER) + val CONST_VAL_WITH_GETTER by error0() + val CONST_VAL_WITH_DELEGATE by error0() val TYPE_CANT_BE_USED_FOR_CONST_VAL by error1(SourceElementPositioningStrategies.CONST_MODIFIER) val CONST_VAL_WITHOUT_INITIALIZER by error0(SourceElementPositioningStrategies.CONST_MODIFIER) val CONST_VAL_WITH_NON_CONST_INITIALIZER by error0() @@ -425,7 +422,7 @@ object FirErrors { // Multi-platform projects val EXPECTED_DECLARATION_WITH_BODY by error0(SourceElementPositioningStrategies.DECLARATION_SIGNATURE) val EXPECTED_PROPERTY_INITIALIZER by error0() - val EXPECTED_DELEGATED_PROPERTY by error0() + val EXPECTED_DELEGATED_PROPERTY by error0() val EXPECTED_LATEINIT_PROPERTY by error0(SourceElementPositioningStrategies.LATEINIT_MODIFIER) // Destructuring declaration @@ -493,20 +490,20 @@ object FirErrors { val DELEGATE_SPECIAL_FUNCTION_AMBIGUITY by error2>>() val DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE by error2>>() val DELEGATE_SPECIAL_FUNCTION_RETURN_TYPE_MISMATCH by error3() - val UNDERSCORE_IS_RESERVED by error0(SourceElementPositioningStrategies.RESERVED_UNDERSCORE) - val UNDERSCORE_USAGE_WITHOUT_BACKTICKS by error0(SourceElementPositioningStrategies.RESERVED_UNDERSCORE) + val UNDERSCORE_IS_RESERVED by error0(SourceElementPositioningStrategies.RESERVED_UNDERSCORE) + val UNDERSCORE_USAGE_WITHOUT_BACKTICKS by error0(SourceElementPositioningStrategies.RESERVED_UNDERSCORE) val EQUALITY_NOT_APPLICABLE by error3() val EQUALITY_NOT_APPLICABLE_WARNING by warning3() val INCOMPATIBLE_ENUM_COMPARISON_ERROR by error2() // Type alias val TOPLEVEL_TYPEALIASES_ONLY by error0() - val RECURSIVE_TYPEALIAS_EXPANSION by error0() + val RECURSIVE_TYPEALIAS_EXPANSION by error0() // Extended checkers val REDUNDANT_VISIBILITY_MODIFIER by warning0(SourceElementPositioningStrategies.VISIBILITY_MODIFIER) val REDUNDANT_MODALITY_MODIFIER by warning0(SourceElementPositioningStrategies.MODALITY_MODIFIER) - val REDUNDANT_RETURN_UNIT_TYPE by warning0() + val REDUNDANT_RETURN_UNIT_TYPE by warning0() val REDUNDANT_EXPLICIT_TYPE by warning0() val REDUNDANT_SINGLE_EXPRESSION_STRING_TEMPLATE by warning0() val CAN_BE_VAL by warning0(SourceElementPositioningStrategies.VAL_OR_VAR_NODE) @@ -537,10 +534,10 @@ object FirErrors { val SUPER_CALL_FROM_PUBLIC_INLINE by warning1>(SourceElementPositioningStrategies.REFERENCE_BY_QUALIFIED) // Imports - val CANNOT_ALL_UNDER_IMPORT_FROM_SINGLETON by error1(SourceElementPositioningStrategies.IMPORT_LAST_NAME) - val PACKAGE_CANNOT_BE_IMPORTED by error0(SourceElementPositioningStrategies.IMPORT_LAST_NAME) - val CANNOT_BE_IMPORTED by error1(SourceElementPositioningStrategies.IMPORT_LAST_NAME) + val CANNOT_ALL_UNDER_IMPORT_FROM_SINGLETON by error1(SourceElementPositioningStrategies.IMPORT_LAST_NAME) + val PACKAGE_CANNOT_BE_IMPORTED by error0(SourceElementPositioningStrategies.IMPORT_LAST_NAME) + val CANNOT_BE_IMPORTED by error1(SourceElementPositioningStrategies.IMPORT_LAST_NAME) val CONFLICTING_IMPORT by error1(SourceElementPositioningStrategies.IMPORT_LAST_NAME) - val OPERATOR_RENAMED_ON_IMPORT by error0(SourceElementPositioningStrategies.IMPORT_LAST_NAME) + val OPERATOR_RENAMED_ON_IMPORT by error0(SourceElementPositioningStrategies.IMPORT_LAST_NAME) } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirAnnotationArgumentChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirAnnotationArgumentChecker.kt index 44f6a0c343a..6a7d7f0dab0 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirAnnotationArgumentChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirAnnotationArgumentChecker.kt @@ -86,7 +86,7 @@ object FirAnnotationArgumentChecker : FirAnnotationCallChecker() { is FirArrayOfCall -> return checkArgumentList(expression.argumentList) is FirVarargArgumentsExpression -> { for (arg in expression.arguments) { - val unwrappedArg = if (arg is FirSpreadArgumentExpression) arg.expression else arg + val unwrappedArg = arg.unwrapArgument() checkAnnotationArgumentWithSubElements(unwrappedArg, session, reporter, context) ?.let { reporter.reportOn(unwrappedArg.source, it, context) } } diff --git a/compiler/testData/diagnostics/tests/varargs/assignNonConstSingleArrayElementAsVarargInAnnotation.fir.kt b/compiler/testData/diagnostics/tests/varargs/assignNonConstSingleArrayElementAsVarargInAnnotation.fir.kt index c2c506d90bb..6c540ad4bb0 100644 --- a/compiler/testData/diagnostics/tests/varargs/assignNonConstSingleArrayElementAsVarargInAnnotation.fir.kt +++ b/compiler/testData/diagnostics/tests/varargs/assignNonConstSingleArrayElementAsVarargInAnnotation.fir.kt @@ -7,19 +7,19 @@ fun nonConstLong(): Long = TODO() annotation class Anno(vararg val value: Long) -@Anno(value = nonConstArray) +@Anno(value = nonConstArray) fun foo1() {} -@Anno(value = nonConstFun()) +@Anno(value = nonConstFun()) fun foo2() {} -@Anno(value = longArrayOf(nonConstLong())) +@Anno(value = longArrayOf(nonConstLong())) fun foo3() {} -@Anno(value = [nonConstLong()]) +@Anno(value = [nonConstLong()]) fun foo4() {} -@Anno(value = *nonConstArray) +@Anno(value = *nonConstArray) fun bar1() {} @Anno(*nonConstArray) diff --git a/compiler/testData/diagnostics/tests/varargs/assignNonConstSingleArrayElementAsVarargInAnnotationError.fir.kt b/compiler/testData/diagnostics/tests/varargs/assignNonConstSingleArrayElementAsVarargInAnnotationError.fir.kt index b7a6af9478c..42ce3fff26c 100644 --- a/compiler/testData/diagnostics/tests/varargs/assignNonConstSingleArrayElementAsVarargInAnnotationError.fir.kt +++ b/compiler/testData/diagnostics/tests/varargs/assignNonConstSingleArrayElementAsVarargInAnnotationError.fir.kt @@ -7,19 +7,19 @@ fun nonConstLong(): Long = TODO() annotation class Anno(vararg val value: Long) -@Anno(value = nonConstArray) +@Anno(value = nonConstArray) fun foo1() {} -@Anno(value = nonConstFun()) +@Anno(value = nonConstFun()) fun foo2() {} -@Anno(value = longArrayOf(nonConstLong())) +@Anno(value = longArrayOf(nonConstLong())) fun foo3() {} -@Anno(value = [nonConstLong()]) +@Anno(value = [nonConstLong()]) fun foo4() {} -@Anno(value = *nonConstArray) +@Anno(value = *nonConstArray) fun bar1() {} @Anno(*nonConstArray) diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDataClassConverters.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDataClassConverters.kt index 6456deb569c..3fa0e8b5e40 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDataClassConverters.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDataClassConverters.kt @@ -6,7 +6,6 @@ package org.jetbrains.kotlin.idea.frontend.api.fir.diagnostics import com.intellij.psi.PsiElement -import com.intellij.psi.PsiTypeElement import com.intellij.psi.impl.source.tree.LeafPsiElement import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors import org.jetbrains.kotlin.fir.analysis.diagnostics.FirPsiDiagnostic @@ -21,7 +20,6 @@ import org.jetbrains.kotlin.fir.declarations.FirTypeParameter import org.jetbrains.kotlin.fir.declarations.FirVariable import org.jetbrains.kotlin.fir.psi import org.jetbrains.kotlin.idea.frontend.api.symbols.KtNamedClassOrObjectSymbol -import org.jetbrains.kotlin.psi.KtAnnotation import org.jetbrains.kotlin.psi.KtAnnotationEntry import org.jetbrains.kotlin.psi.KtArrayAccessExpression import org.jetbrains.kotlin.psi.KtBinaryExpression @@ -43,12 +41,11 @@ import org.jetbrains.kotlin.psi.KtParameter import org.jetbrains.kotlin.psi.KtPrimaryConstructor import org.jetbrains.kotlin.psi.KtProperty import org.jetbrains.kotlin.psi.KtPropertyAccessor -import org.jetbrains.kotlin.psi.KtPropertyDelegate import org.jetbrains.kotlin.psi.KtReturnExpression import org.jetbrains.kotlin.psi.KtSimpleNameExpression import org.jetbrains.kotlin.psi.KtTypeAlias import org.jetbrains.kotlin.psi.KtTypeParameter -import org.jetbrains.kotlin.psi.KtTypeParameterList +import org.jetbrains.kotlin.psi.KtTypeProjection import org.jetbrains.kotlin.psi.KtTypeReference import org.jetbrains.kotlin.psi.KtValueArgument import org.jetbrains.kotlin.psi.KtWhenEntry diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnostics.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnostics.kt index ee7ca38c3ac..3d131387e57 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnostics.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnostics.kt @@ -6,7 +6,6 @@ package org.jetbrains.kotlin.idea.frontend.api.fir.diagnostics import com.intellij.psi.PsiElement -import com.intellij.psi.PsiTypeElement import com.intellij.psi.impl.source.tree.LeafPsiElement import org.jetbrains.kotlin.config.LanguageFeature import org.jetbrains.kotlin.config.LanguageVersionSettings @@ -28,7 +27,6 @@ import org.jetbrains.kotlin.lexer.KtKeywordToken import org.jetbrains.kotlin.lexer.KtModifierKeywordToken import org.jetbrains.kotlin.name.FqName import org.jetbrains.kotlin.name.Name -import org.jetbrains.kotlin.psi.KtAnnotation import org.jetbrains.kotlin.psi.KtAnnotationEntry import org.jetbrains.kotlin.psi.KtArrayAccessExpression import org.jetbrains.kotlin.psi.KtBinaryExpression @@ -50,12 +48,11 @@ import org.jetbrains.kotlin.psi.KtParameter import org.jetbrains.kotlin.psi.KtPrimaryConstructor import org.jetbrains.kotlin.psi.KtProperty import org.jetbrains.kotlin.psi.KtPropertyAccessor -import org.jetbrains.kotlin.psi.KtPropertyDelegate import org.jetbrains.kotlin.psi.KtReturnExpression import org.jetbrains.kotlin.psi.KtSimpleNameExpression import org.jetbrains.kotlin.psi.KtTypeAlias import org.jetbrains.kotlin.psi.KtTypeParameter -import org.jetbrains.kotlin.psi.KtTypeParameterList +import org.jetbrains.kotlin.psi.KtTypeProjection import org.jetbrains.kotlin.psi.KtTypeReference import org.jetbrains.kotlin.psi.KtValueArgument import org.jetbrains.kotlin.psi.KtWhenEntry @@ -431,7 +428,7 @@ sealed class KtFirDiagnostic : KtDiagnosticWithPsi { override val diagnosticClass get() = SupertypesForAnnotationClass::class } - abstract class AnnotationUsedAsAnnotationArgument : KtFirDiagnostic() { + abstract class AnnotationUsedAsAnnotationArgument : KtFirDiagnostic() { override val diagnosticClass get() = AnnotationUsedAsAnnotationArgument::class } @@ -783,7 +780,7 @@ sealed class KtFirDiagnostic : KtDiagnosticWithPsi { abstract val reason: String } - abstract class VarargOutsideParentheses : KtFirDiagnostic() { + abstract class VarargOutsideParentheses : KtFirDiagnostic() { override val diagnosticClass get() = VarargOutsideParentheses::class } @@ -906,17 +903,17 @@ sealed class KtFirDiagnostic : KtDiagnosticWithPsi { override val diagnosticClass get() = TypeParametersInEnum::class } - abstract class ConflictingProjection : KtFirDiagnostic() { + abstract class ConflictingProjection : KtFirDiagnostic() { override val diagnosticClass get() = ConflictingProjection::class abstract val type: KtType } - abstract class ConflictingProjectionInTypealiasExpansion : KtFirDiagnostic() { + abstract class ConflictingProjectionInTypealiasExpansion : KtFirDiagnostic() { override val diagnosticClass get() = ConflictingProjectionInTypealiasExpansion::class abstract val type: KtType } - abstract class RedundantProjection : KtFirDiagnostic() { + abstract class RedundantProjection : KtFirDiagnostic() { override val diagnosticClass get() = RedundantProjection::class abstract val type: KtType } @@ -937,7 +934,7 @@ sealed class KtFirDiagnostic : KtDiagnosticWithPsi { override val diagnosticClass get() = TypeParameterInCatchClause::class } - abstract class GenericThrowableSubclass : KtFirDiagnostic() { + abstract class GenericThrowableSubclass : KtFirDiagnostic() { override val diagnosticClass get() = GenericThrowableSubclass::class } @@ -1281,7 +1278,7 @@ sealed class KtFirDiagnostic : KtDiagnosticWithPsi { override val diagnosticClass get() = ValueParameterWithNoTypeAnnotation::class } - abstract class CannotInferParameterType : KtFirDiagnostic() { + abstract class CannotInferParameterType : KtFirDiagnostic() { override val diagnosticClass get() = CannotInferParameterType::class } @@ -1359,11 +1356,11 @@ sealed class KtFirDiagnostic : KtDiagnosticWithPsi { override val diagnosticClass get() = PropertyInitializerNoBackingField::class } - abstract class AbstractDelegatedProperty : KtFirDiagnostic() { + abstract class AbstractDelegatedProperty : KtFirDiagnostic() { override val diagnosticClass get() = AbstractDelegatedProperty::class } - abstract class DelegatedPropertyInInterface : KtFirDiagnostic() { + abstract class DelegatedPropertyInInterface : KtFirDiagnostic() { override val diagnosticClass get() = DelegatedPropertyInInterface::class } @@ -1391,15 +1388,15 @@ sealed class KtFirDiagnostic : KtDiagnosticWithPsi { override val diagnosticClass get() = ValWithSetter::class } - abstract class ConstValNotTopLevelOrObject : KtFirDiagnostic() { + abstract class ConstValNotTopLevelOrObject : KtFirDiagnostic() { override val diagnosticClass get() = ConstValNotTopLevelOrObject::class } - abstract class ConstValWithGetter : KtFirDiagnostic() { + abstract class ConstValWithGetter : KtFirDiagnostic() { override val diagnosticClass get() = ConstValWithGetter::class } - abstract class ConstValWithDelegate : KtFirDiagnostic() { + abstract class ConstValWithDelegate : KtFirDiagnostic() { override val diagnosticClass get() = ConstValWithDelegate::class } @@ -1458,7 +1455,7 @@ sealed class KtFirDiagnostic : KtDiagnosticWithPsi { override val diagnosticClass get() = ExpectedPropertyInitializer::class } - abstract class ExpectedDelegatedProperty : KtFirDiagnostic() { + abstract class ExpectedDelegatedProperty : KtFirDiagnostic() { override val diagnosticClass get() = ExpectedDelegatedProperty::class } @@ -1717,11 +1714,11 @@ sealed class KtFirDiagnostic : KtDiagnosticWithPsi { abstract val actualType: KtType } - abstract class UnderscoreIsReserved : KtFirDiagnostic() { + abstract class UnderscoreIsReserved : KtFirDiagnostic() { override val diagnosticClass get() = UnderscoreIsReserved::class } - abstract class UnderscoreUsageWithoutBackticks : KtFirDiagnostic() { + abstract class UnderscoreUsageWithoutBackticks : KtFirDiagnostic() { override val diagnosticClass get() = UnderscoreUsageWithoutBackticks::class } @@ -1749,7 +1746,7 @@ sealed class KtFirDiagnostic : KtDiagnosticWithPsi { override val diagnosticClass get() = ToplevelTypealiasesOnly::class } - abstract class RecursiveTypealiasExpansion : KtFirDiagnostic() { + abstract class RecursiveTypealiasExpansion : KtFirDiagnostic() { override val diagnosticClass get() = RecursiveTypealiasExpansion::class } @@ -1761,7 +1758,7 @@ sealed class KtFirDiagnostic : KtDiagnosticWithPsi { override val diagnosticClass get() = RedundantModalityModifier::class } - abstract class RedundantReturnUnitType : KtFirDiagnostic() { + abstract class RedundantReturnUnitType : KtFirDiagnostic() { override val diagnosticClass get() = RedundantReturnUnitType::class } @@ -1875,16 +1872,16 @@ sealed class KtFirDiagnostic : KtDiagnosticWithPsi { abstract val symbol: KtSymbol } - abstract class CannotAllUnderImportFromSingleton : KtFirDiagnostic() { + abstract class CannotAllUnderImportFromSingleton : KtFirDiagnostic() { override val diagnosticClass get() = CannotAllUnderImportFromSingleton::class abstract val objectName: Name } - abstract class PackageCannotBeImported : KtFirDiagnostic() { + abstract class PackageCannotBeImported : KtFirDiagnostic() { override val diagnosticClass get() = PackageCannotBeImported::class } - abstract class CannotBeImported : KtFirDiagnostic() { + abstract class CannotBeImported : KtFirDiagnostic() { override val diagnosticClass get() = CannotBeImported::class abstract val name: Name } @@ -1894,7 +1891,7 @@ sealed class KtFirDiagnostic : KtDiagnosticWithPsi { abstract val name: Name } - abstract class OperatorRenamedOnImport : KtFirDiagnostic() { + abstract class OperatorRenamedOnImport : KtFirDiagnostic() { override val diagnosticClass get() = OperatorRenamedOnImport::class } diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnosticsImpl.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnosticsImpl.kt index edd8c9d9245..0e224e41b0f 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnosticsImpl.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnosticsImpl.kt @@ -6,7 +6,6 @@ package org.jetbrains.kotlin.idea.frontend.api.fir.diagnostics import com.intellij.psi.PsiElement -import com.intellij.psi.PsiTypeElement import com.intellij.psi.impl.source.tree.LeafPsiElement import org.jetbrains.kotlin.config.LanguageFeature import org.jetbrains.kotlin.config.LanguageVersionSettings @@ -30,7 +29,6 @@ import org.jetbrains.kotlin.lexer.KtKeywordToken import org.jetbrains.kotlin.lexer.KtModifierKeywordToken import org.jetbrains.kotlin.name.FqName import org.jetbrains.kotlin.name.Name -import org.jetbrains.kotlin.psi.KtAnnotation import org.jetbrains.kotlin.psi.KtAnnotationEntry import org.jetbrains.kotlin.psi.KtArrayAccessExpression import org.jetbrains.kotlin.psi.KtBinaryExpression @@ -52,12 +50,11 @@ import org.jetbrains.kotlin.psi.KtParameter import org.jetbrains.kotlin.psi.KtPrimaryConstructor import org.jetbrains.kotlin.psi.KtProperty import org.jetbrains.kotlin.psi.KtPropertyAccessor -import org.jetbrains.kotlin.psi.KtPropertyDelegate import org.jetbrains.kotlin.psi.KtReturnExpression import org.jetbrains.kotlin.psi.KtSimpleNameExpression import org.jetbrains.kotlin.psi.KtTypeAlias import org.jetbrains.kotlin.psi.KtTypeParameter -import org.jetbrains.kotlin.psi.KtTypeParameterList +import org.jetbrains.kotlin.psi.KtTypeProjection import org.jetbrains.kotlin.psi.KtTypeReference import org.jetbrains.kotlin.psi.KtValueArgument import org.jetbrains.kotlin.psi.KtWhenEntry @@ -696,7 +693,7 @@ internal class SupertypesForAnnotationClassImpl( internal class AnnotationUsedAsAnnotationArgumentImpl( firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, -) : KtFirDiagnostic.AnnotationUsedAsAnnotationArgument(), KtAbstractFirDiagnostic { +) : KtFirDiagnostic.AnnotationUsedAsAnnotationArgument(), KtAbstractFirDiagnostic { override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } @@ -1261,7 +1258,7 @@ internal class InapplicableLateinitModifierImpl( internal class VarargOutsideParenthesesImpl( firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, -) : KtFirDiagnostic.VarargOutsideParentheses(), KtAbstractFirDiagnostic { +) : KtFirDiagnostic.VarargOutsideParentheses(), KtAbstractFirDiagnostic { override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } @@ -1463,7 +1460,7 @@ internal class ConflictingProjectionImpl( override val type: KtType, firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, -) : KtFirDiagnostic.ConflictingProjection(), KtAbstractFirDiagnostic { +) : KtFirDiagnostic.ConflictingProjection(), KtAbstractFirDiagnostic { override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } @@ -1471,7 +1468,7 @@ internal class ConflictingProjectionInTypealiasExpansionImpl( override val type: KtType, firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, -) : KtFirDiagnostic.ConflictingProjectionInTypealiasExpansion(), KtAbstractFirDiagnostic { +) : KtFirDiagnostic.ConflictingProjectionInTypealiasExpansion(), KtAbstractFirDiagnostic { override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } @@ -1479,7 +1476,7 @@ internal class RedundantProjectionImpl( override val type: KtType, firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, -) : KtFirDiagnostic.RedundantProjection(), KtAbstractFirDiagnostic { +) : KtFirDiagnostic.RedundantProjection(), KtAbstractFirDiagnostic { override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } @@ -1514,7 +1511,7 @@ internal class TypeParameterInCatchClauseImpl( internal class GenericThrowableSubclassImpl( firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, -) : KtFirDiagnostic.GenericThrowableSubclass(), KtAbstractFirDiagnostic { +) : KtFirDiagnostic.GenericThrowableSubclass(), KtAbstractFirDiagnostic { override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } @@ -2062,7 +2059,7 @@ internal class ValueParameterWithNoTypeAnnotationImpl( internal class CannotInferParameterTypeImpl( firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, -) : KtFirDiagnostic.CannotInferParameterType(), KtAbstractFirDiagnostic { +) : KtFirDiagnostic.CannotInferParameterType(), KtAbstractFirDiagnostic { override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } @@ -2197,14 +2194,14 @@ internal class PropertyInitializerNoBackingFieldImpl( internal class AbstractDelegatedPropertyImpl( firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, -) : KtFirDiagnostic.AbstractDelegatedProperty(), KtAbstractFirDiagnostic { +) : KtFirDiagnostic.AbstractDelegatedProperty(), KtAbstractFirDiagnostic { override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class DelegatedPropertyInInterfaceImpl( firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, -) : KtFirDiagnostic.DelegatedPropertyInInterface(), KtAbstractFirDiagnostic { +) : KtFirDiagnostic.DelegatedPropertyInInterface(), KtAbstractFirDiagnostic { override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } @@ -2253,21 +2250,21 @@ internal class ValWithSetterImpl( internal class ConstValNotTopLevelOrObjectImpl( firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, -) : KtFirDiagnostic.ConstValNotTopLevelOrObject(), KtAbstractFirDiagnostic { +) : KtFirDiagnostic.ConstValNotTopLevelOrObject(), KtAbstractFirDiagnostic { override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ConstValWithGetterImpl( firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, -) : KtFirDiagnostic.ConstValWithGetter(), KtAbstractFirDiagnostic { +) : KtFirDiagnostic.ConstValWithGetter(), KtAbstractFirDiagnostic { override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ConstValWithDelegateImpl( firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, -) : KtFirDiagnostic.ConstValWithDelegate(), KtAbstractFirDiagnostic { +) : KtFirDiagnostic.ConstValWithDelegate(), KtAbstractFirDiagnostic { override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } @@ -2365,7 +2362,7 @@ internal class ExpectedPropertyInitializerImpl( internal class ExpectedDelegatedPropertyImpl( firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, -) : KtFirDiagnostic.ExpectedDelegatedProperty(), KtAbstractFirDiagnostic { +) : KtFirDiagnostic.ExpectedDelegatedProperty(), KtAbstractFirDiagnostic { override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } @@ -2780,14 +2777,14 @@ internal class DelegateSpecialFunctionReturnTypeMismatchImpl( internal class UnderscoreIsReservedImpl( firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, -) : KtFirDiagnostic.UnderscoreIsReserved(), KtAbstractFirDiagnostic { +) : KtFirDiagnostic.UnderscoreIsReserved(), KtAbstractFirDiagnostic { override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class UnderscoreUsageWithoutBackticksImpl( firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, -) : KtFirDiagnostic.UnderscoreUsageWithoutBackticks(), KtAbstractFirDiagnostic { +) : KtFirDiagnostic.UnderscoreUsageWithoutBackticks(), KtAbstractFirDiagnostic { override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } @@ -2830,7 +2827,7 @@ internal class ToplevelTypealiasesOnlyImpl( internal class RecursiveTypealiasExpansionImpl( firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, -) : KtFirDiagnostic.RecursiveTypealiasExpansion(), KtAbstractFirDiagnostic { +) : KtFirDiagnostic.RecursiveTypealiasExpansion(), KtAbstractFirDiagnostic { override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } @@ -2851,7 +2848,7 @@ internal class RedundantModalityModifierImpl( internal class RedundantReturnUnitTypeImpl( firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, -) : KtFirDiagnostic.RedundantReturnUnitType(), KtAbstractFirDiagnostic { +) : KtFirDiagnostic.RedundantReturnUnitType(), KtAbstractFirDiagnostic { override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } @@ -3041,14 +3038,14 @@ internal class CannotAllUnderImportFromSingletonImpl( override val objectName: Name, firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, -) : KtFirDiagnostic.CannotAllUnderImportFromSingleton(), KtAbstractFirDiagnostic { +) : KtFirDiagnostic.CannotAllUnderImportFromSingleton(), KtAbstractFirDiagnostic { override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class PackageCannotBeImportedImpl( firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, -) : KtFirDiagnostic.PackageCannotBeImported(), KtAbstractFirDiagnostic { +) : KtFirDiagnostic.PackageCannotBeImported(), KtAbstractFirDiagnostic { override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } @@ -3056,7 +3053,7 @@ internal class CannotBeImportedImpl( override val name: Name, firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, -) : KtFirDiagnostic.CannotBeImported(), KtAbstractFirDiagnostic { +) : KtFirDiagnostic.CannotBeImported(), KtAbstractFirDiagnostic { override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } @@ -3071,7 +3068,7 @@ internal class ConflictingImportImpl( internal class OperatorRenamedOnImportImpl( firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, -) : KtFirDiagnostic.OperatorRenamedOnImport(), KtAbstractFirDiagnostic { +) : KtFirDiagnostic.OperatorRenamedOnImport(), KtAbstractFirDiagnostic { override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) }