[FIR] Add illegal underscore diagnostic

This commit is contained in:
Ivan Kylchik
2020-07-02 16:31:25 +03:00
parent 54945b7fbc
commit cc4b50fdc1
4 changed files with 5 additions and 0 deletions
@@ -70,6 +70,7 @@ class ErrorNodeDiagnosticCollectorComponent(collector: AbstractDiagnosticCollect
ReturnNotAllowed -> FirErrors.RETURN_NOT_ALLOWED
UnresolvedLabel -> FirErrors.UNRESOLVED_LABEL
IllegalConstExpression -> FirErrors.ILLEGAL_CONST_EXPRESSION
IllegalUnderscore -> FirErrors.ILLEGAL_UNDERSCORE
DeserializationError -> FirErrors.DESERIALIZATION_ERROR
InferenceError -> FirErrors.INFERENCE_ERROR
TypeParameterAsSupertype -> FirErrors.TYPE_PARAMETER_AS_SUPERTYPE
@@ -23,6 +23,7 @@ import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.EXPOSED_PROPERTY_
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.EXPOSED_RECEIVER_TYPE
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.EXPOSED_TYPEALIAS_EXPANDED_TYPE
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ILLEGAL_CONST_EXPRESSION
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ILLEGAL_UNDERSCORE
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.INAPPLICABLE_CANDIDATE
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.INCOMPATIBLE_MODIFIERS
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.INFERENCE_ERROR
@@ -53,6 +54,7 @@ class FirDefaultErrorMessages : DefaultErrorMessages.Extension {
map.put(SYNTAX_ERROR, "Syntax error")
map.put(UNRESOLVED_LABEL, "Unresolved label")
map.put(ILLEGAL_CONST_EXPRESSION, "Illegal const expression")
map.put(ILLEGAL_UNDERSCORE, "Illegal underscore")
map.put(DESERIALIZATION_ERROR, "Deserialization error")
map.put(INFERENCE_ERROR, "Inference error")
map.put(TYPE_PARAMETER_AS_SUPERTYPE, "Type parameter as supertype")
@@ -27,6 +27,7 @@ object FirErrors {
val SYNTAX_ERROR by error0<FirSourceElement, PsiElement>()
val UNRESOLVED_LABEL by error0<FirSourceElement, PsiElement>()
val ILLEGAL_CONST_EXPRESSION by error0<FirSourceElement, PsiElement>()
val ILLEGAL_UNDERSCORE by error0<FirSourceElement, PsiElement>()
val DESERIALIZATION_ERROR by error0<FirSourceElement, PsiElement>()
val INFERENCE_ERROR by error0<FirSourceElement, PsiElement>()
val TYPE_PARAMETER_AS_SUPERTYPE by error0<FirSourceElement, PsiElement>()
@@ -17,6 +17,7 @@ enum class DiagnosticKind {
ReturnNotAllowed,
UnresolvedLabel,
IllegalConstExpression,
IllegalUnderscore,
DeserializationError,
InferenceError,
TypeParameterAsSupertype,