FIR: fix EXPRESSION_REQUIRED positioning

This commit is contained in:
Mikhail Glukhikh
2021-02-18 16:25:13 +03:00
parent 588b1354f6
commit 54139b83ce
3 changed files with 3 additions and 3 deletions
@@ -36,7 +36,7 @@ object DIAGNOSTICS_LIST : DiagnosticList() {
val GENERAL_SYNTAX by object : DiagnosticGroup("General syntax") {
val ILLEGAL_CONST_EXPRESSION by error<FirSourceElement, PsiElement>()
val ILLEGAL_UNDERSCORE by error<FirSourceElement, PsiElement>()
val EXPRESSION_REQUIRED by error<FirSourceElement, PsiElement>()
val EXPRESSION_REQUIRED by error<FirSourceElement, PsiElement>(PositioningStrategy.SELECTOR_BY_QUALIFIED)
val BREAK_OR_CONTINUE_OUTSIDE_A_LOOP by error<FirSourceElement, PsiElement>()
val NOT_A_LOOP_LABEL by error<FirSourceElement, PsiElement>()
val VARIABLE_EXPECTED by error<FirSourceElement, PsiElement>()
@@ -55,7 +55,7 @@ object FirErrors {
// General syntax
val ILLEGAL_CONST_EXPRESSION by error0<FirSourceElement, PsiElement>()
val ILLEGAL_UNDERSCORE by error0<FirSourceElement, PsiElement>()
val EXPRESSION_REQUIRED by error0<FirSourceElement, PsiElement>()
val EXPRESSION_REQUIRED by error0<FirSourceElement, PsiElement>(SourceElementPositioningStrategies.SELECTOR_BY_QUALIFIED)
val BREAK_OR_CONTINUE_OUTSIDE_A_LOOP by error0<FirSourceElement, PsiElement>()
val NOT_A_LOOP_LABEL by error0<FirSourceElement, PsiElement>()
val VARIABLE_EXPECTED by error0<FirSourceElement, PsiElement>()
@@ -726,7 +726,7 @@ object PositioningStrategies {
override fun mark(element: PsiElement): List<TextRange> {
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)