[FE JS] Support until operator in WRONG_OPERATION_WITH_DYNAMIC error

This commit is contained in:
Victor Petukhov
2022-05-23 14:58:14 +02:00
committed by teamcity
parent 0b25ce4de9
commit 2378979a99
6 changed files with 39 additions and 3 deletions
@@ -19,6 +19,7 @@ package org.jetbrains.kotlin.js.resolve.diagnostics
import com.intellij.psi.PsiElement
import org.jetbrains.kotlin.config.LanguageFeature
import org.jetbrains.kotlin.js.naming.NameSuggestion
import org.jetbrains.kotlin.lexer.KtSingleValueToken
import org.jetbrains.kotlin.lexer.KtTokens
import org.jetbrains.kotlin.psi.*
import org.jetbrains.kotlin.resolve.calls.checkers.CallChecker
@@ -53,8 +54,9 @@ object JsDynamicCallChecker : CallChecker {
in OperatorConventions.IN_OPERATIONS -> {
reportInOperation(context, reportOn)
}
KtTokens.RANGE -> {
context.trace.report(ErrorsJs.WRONG_OPERATION_WITH_DYNAMIC.on(reportOn, "`..` operation"))
KtTokens.RANGE, KtTokens.RANGE_UNTIL -> {
token as KtSingleValueToken
context.trace.report(ErrorsJs.WRONG_OPERATION_WITH_DYNAMIC.on(reportOn, "`${token.value}` operation"))
}
}
}