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 a0b79fab942..5b20f6504c4 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 @@ -36,7 +36,7 @@ object DIAGNOSTICS_LIST : DiagnosticList() { val GENERAL_SYNTAX by object : DiagnosticGroup("General syntax") { val ILLEGAL_CONST_EXPRESSION by error() val ILLEGAL_UNDERSCORE by error() - val EXPRESSION_REQUIRED by error() + val EXPRESSION_REQUIRED by error(PositioningStrategy.SELECTOR_BY_QUALIFIED) val BREAK_OR_CONTINUE_OUTSIDE_A_LOOP by error() val NOT_A_LOOP_LABEL by error() val VARIABLE_EXPECTED by error() 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 0c04d5c6dcc..602d1cc9137 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 @@ -55,7 +55,7 @@ object FirErrors { // General syntax val ILLEGAL_CONST_EXPRESSION by error0() val ILLEGAL_UNDERSCORE by error0() - val EXPRESSION_REQUIRED by error0() + val EXPRESSION_REQUIRED by error0(SourceElementPositioningStrategies.SELECTOR_BY_QUALIFIED) val BREAK_OR_CONTINUE_OUTSIDE_A_LOOP by error0() val NOT_A_LOOP_LABEL by error0() val VARIABLE_EXPECTED by error0() diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/PositioningStrategies.kt b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/PositioningStrategies.kt index 2d1cdd07752..602933b4938 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/PositioningStrategies.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/PositioningStrategies.kt @@ -726,7 +726,7 @@ object PositioningStrategies { override fun mark(element: PsiElement): List { if (element is KtQualifiedExpression) { when (val selectorExpression = element.selectorExpression) { - is KtCallExpression, is KtReferenceExpression -> return mark(selectorExpression) + is KtElement -> return mark(selectorExpression) } } return super.mark(element)