[FIR] Fix PSI types of some diagnostics

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