[FIR] Implement ILLEGAL_SELECTOR
This commit is contained in:
+1
@@ -106,6 +106,7 @@ object DIAGNOSTICS_LIST : DiagnosticList("FirErrors") {
|
|||||||
parameter<String>("functionName")
|
parameter<String>("functionName")
|
||||||
parameter<Boolean>("hasValueParameters")
|
parameter<Boolean>("hasValueParameters")
|
||||||
}
|
}
|
||||||
|
val ILLEGAL_SELECTOR by error<PsiElement>()
|
||||||
}
|
}
|
||||||
|
|
||||||
val SUPER by object : DiagnosticGroup("Super") {
|
val SUPER by object : DiagnosticGroup("Super") {
|
||||||
|
|||||||
@@ -120,6 +120,7 @@ object FirErrors {
|
|||||||
// Call resolution
|
// Call resolution
|
||||||
val CREATING_AN_INSTANCE_OF_ABSTRACT_CLASS by error0<KtExpression>()
|
val CREATING_AN_INSTANCE_OF_ABSTRACT_CLASS by error0<KtExpression>()
|
||||||
val FUNCTION_CALL_EXPECTED by error2<PsiElement, String, Boolean>(SourceElementPositioningStrategies.REFERENCED_NAME_BY_QUALIFIED)
|
val FUNCTION_CALL_EXPECTED by error2<PsiElement, String, Boolean>(SourceElementPositioningStrategies.REFERENCED_NAME_BY_QUALIFIED)
|
||||||
|
val ILLEGAL_SELECTOR by error0<PsiElement>()
|
||||||
|
|
||||||
// Super
|
// Super
|
||||||
val SUPER_IS_NOT_AN_EXPRESSION by error0<PsiElement>(SourceElementPositioningStrategies.REFERENCED_NAME_BY_QUALIFIED)
|
val SUPER_IS_NOT_AN_EXPRESSION by error0<PsiElement>(SourceElementPositioningStrategies.REFERENCED_NAME_BY_QUALIFIED)
|
||||||
|
|||||||
@@ -579,8 +579,9 @@ fun checkTypeMismatch(
|
|||||||
}
|
}
|
||||||
|
|
||||||
internal fun checkCondition(condition: FirExpression, context: CheckerContext, reporter: DiagnosticReporter) {
|
internal fun checkCondition(condition: FirExpression, context: CheckerContext, reporter: DiagnosticReporter) {
|
||||||
val coneType = condition.typeRef.coneType.lowerBoundIfFlexible()
|
val coneType = condition.typeRef.coneTypeSafe<ConeKotlinType>()?.lowerBoundIfFlexible()
|
||||||
if (coneType !is ConeKotlinErrorType &&
|
if (coneType != null &&
|
||||||
|
coneType !is ConeKotlinErrorType &&
|
||||||
!coneType.isSubtypeOf(context.session.typeContext, context.session.builtinTypes.booleanType.type)
|
!coneType.isSubtypeOf(context.session.typeContext, context.session.builtinTypes.booleanType.type)
|
||||||
) {
|
) {
|
||||||
reporter.reportOn(condition.source, FirErrors.CONDITION_TYPE_MISMATCH, coneType, context)
|
reporter.reportOn(condition.source, FirErrors.CONDITION_TYPE_MISMATCH, coneType, context)
|
||||||
|
|||||||
+2
@@ -163,6 +163,7 @@ import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.GETTER_VISIBILITY
|
|||||||
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.HAS_NEXT_FUNCTION_AMBIGUITY
|
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.HAS_NEXT_FUNCTION_AMBIGUITY
|
||||||
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ILLEGAL_CONST_EXPRESSION
|
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ILLEGAL_CONST_EXPRESSION
|
||||||
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ILLEGAL_KOTLIN_VERSION_STRING_VALUE
|
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ILLEGAL_KOTLIN_VERSION_STRING_VALUE
|
||||||
|
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ILLEGAL_SELECTOR
|
||||||
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ILLEGAL_UNDERSCORE
|
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.INAPPLICABLE_CANDIDATE
|
||||||
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.INAPPLICABLE_FILE_TARGET
|
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.INAPPLICABLE_FILE_TARGET
|
||||||
@@ -446,6 +447,7 @@ class FirDefaultErrorMessages {
|
|||||||
)
|
)
|
||||||
map.put(CREATING_AN_INSTANCE_OF_ABSTRACT_CLASS, "Cannot create an instance of an abstract class")
|
map.put(CREATING_AN_INSTANCE_OF_ABSTRACT_CLASS, "Cannot create an instance of an abstract class")
|
||||||
map.put(FUNCTION_CALL_EXPECTED, "Function invocation ''{0}({1})'' expected", TO_STRING, FUNCTION_PARAMETERS)
|
map.put(FUNCTION_CALL_EXPECTED, "Function invocation ''{0}({1})'' expected", TO_STRING, FUNCTION_PARAMETERS)
|
||||||
|
map.put(ILLEGAL_SELECTOR, "The expression cannot be a selector (occur after a dot)")
|
||||||
|
|
||||||
// Supertypes
|
// Supertypes
|
||||||
map.put(ENUM_AS_SUPERTYPE, "Enum as supertype")
|
map.put(ENUM_AS_SUPERTYPE, "Enum as supertype")
|
||||||
|
|||||||
+1
@@ -360,6 +360,7 @@ private fun ConeSimpleDiagnostic.getFactory(source: FirSourceElement): FirDiagno
|
|||||||
DiagnosticKind.IllegalEscape -> FirErrors.ILLEGAL_ESCAPE
|
DiagnosticKind.IllegalEscape -> FirErrors.ILLEGAL_ESCAPE
|
||||||
DiagnosticKind.RecursiveTypealiasExpansion -> FirErrors.RECURSIVE_TYPEALIAS_EXPANSION
|
DiagnosticKind.RecursiveTypealiasExpansion -> FirErrors.RECURSIVE_TYPEALIAS_EXPANSION
|
||||||
DiagnosticKind.LoopInSupertype -> FirErrors.CYCLIC_INHERITANCE_HIERARCHY
|
DiagnosticKind.LoopInSupertype -> FirErrors.CYCLIC_INHERITANCE_HIERARCHY
|
||||||
|
DiagnosticKind.IllegalSelector -> FirErrors.ILLEGAL_SELECTOR
|
||||||
DiagnosticKind.UnresolvedSupertype,
|
DiagnosticKind.UnresolvedSupertype,
|
||||||
DiagnosticKind.UnresolvedExpandedType,
|
DiagnosticKind.UnresolvedExpandedType,
|
||||||
DiagnosticKind.Other -> FirErrors.OTHER_ERROR
|
DiagnosticKind.Other -> FirErrors.OTHER_ERROR
|
||||||
|
|||||||
+31
-9
@@ -8,6 +8,7 @@ package org.jetbrains.kotlin.fir.lightTree.converter
|
|||||||
import com.intellij.lang.LighterASTNode
|
import com.intellij.lang.LighterASTNode
|
||||||
import com.intellij.psi.TokenType
|
import com.intellij.psi.TokenType
|
||||||
import com.intellij.util.diff.FlyweightCapableTreeStructure
|
import com.intellij.util.diff.FlyweightCapableTreeStructure
|
||||||
|
import org.jetbrains.kotlin.KtNodeTypes
|
||||||
import org.jetbrains.kotlin.KtNodeTypes.*
|
import org.jetbrains.kotlin.KtNodeTypes.*
|
||||||
import org.jetbrains.kotlin.descriptors.Modality
|
import org.jetbrains.kotlin.descriptors.Modality
|
||||||
import org.jetbrains.kotlin.descriptors.Visibilities
|
import org.jetbrains.kotlin.descriptors.Visibilities
|
||||||
@@ -41,6 +42,7 @@ import org.jetbrains.kotlin.fir.types.FirTypeProjection
|
|||||||
import org.jetbrains.kotlin.fir.types.FirTypeRef
|
import org.jetbrains.kotlin.fir.types.FirTypeRef
|
||||||
import org.jetbrains.kotlin.lexer.KtTokens.*
|
import org.jetbrains.kotlin.lexer.KtTokens.*
|
||||||
import org.jetbrains.kotlin.psi.stubs.elements.KtConstantExpressionElementType
|
import org.jetbrains.kotlin.psi.stubs.elements.KtConstantExpressionElementType
|
||||||
|
import org.jetbrains.kotlin.psi.stubs.elements.KtNameReferenceExpressionElementType
|
||||||
import org.jetbrains.kotlin.types.ConstantValueKind
|
import org.jetbrains.kotlin.types.ConstantValueKind
|
||||||
import org.jetbrains.kotlin.types.expressions.OperatorConventions
|
import org.jetbrains.kotlin.types.expressions.OperatorConventions
|
||||||
import org.jetbrains.kotlin.util.OperatorNameConventions
|
import org.jetbrains.kotlin.util.OperatorNameConventions
|
||||||
@@ -196,7 +198,7 @@ class ExpressionsConverter(
|
|||||||
buildSingleExpressionBlock(buildErrorExpression(null, ConeSimpleDiagnostic("Lambda has no body", DiagnosticKind.Syntax)))
|
buildSingleExpressionBlock(buildErrorExpression(null, ConeSimpleDiagnostic("Lambda has no body", DiagnosticKind.Syntax)))
|
||||||
}
|
}
|
||||||
context.firFunctionTargets.removeLast()
|
context.firFunctionTargets.removeLast()
|
||||||
}.also {
|
}.also {
|
||||||
target.bind(it)
|
target.bind(it)
|
||||||
}
|
}
|
||||||
return buildAnonymousFunctionExpression {
|
return buildAnonymousFunctionExpression {
|
||||||
@@ -306,7 +308,7 @@ class ExpressionsConverter(
|
|||||||
else -> if (it.isExpression()) leftArgAsFir = getAsFirExpression(it, "No left operand")
|
else -> if (it.isExpression()) leftArgAsFir = getAsFirExpression(it, "No left operand")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return buildTypeOperatorCall {
|
return buildTypeOperatorCall {
|
||||||
source = binaryExpression.toFirSourceElement()
|
source = binaryExpression.toFirSourceElement()
|
||||||
operation = operationTokenName.toFirOperation()
|
operation = operationTokenName.toFirOperation()
|
||||||
@@ -478,7 +480,7 @@ class ExpressionsConverter(
|
|||||||
private fun convertQualifiedExpression(dotQualifiedExpression: LighterASTNode): FirExpression {
|
private fun convertQualifiedExpression(dotQualifiedExpression: LighterASTNode): FirExpression {
|
||||||
var isSelector = false
|
var isSelector = false
|
||||||
var isSafe = false
|
var isSafe = false
|
||||||
var firSelector: FirExpression = buildErrorExpression(null, ConeSimpleDiagnostic("Qualified expression without selector", DiagnosticKind.Syntax)) //after dot
|
var firSelector: FirExpression? = null
|
||||||
var firReceiver: FirExpression? = null //before dot
|
var firReceiver: FirExpression? = null //before dot
|
||||||
dotQualifiedExpression.forEachChildren {
|
dotQualifiedExpression.forEachChildren {
|
||||||
when (it.tokenType) {
|
when (it.tokenType) {
|
||||||
@@ -488,10 +490,26 @@ class ExpressionsConverter(
|
|||||||
isSelector = true
|
isSelector = true
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
if (isSelector && it.tokenType != TokenType.ERROR_ELEMENT)
|
val isEffectiveSelector = isSelector && it.tokenType != TokenType.ERROR_ELEMENT
|
||||||
firSelector = getAsFirExpression(it, "Incorrect selector expression")
|
val firExpression =
|
||||||
else
|
getAsFirExpression<FirExpression>(it, "Incorrect ${if (isEffectiveSelector) "selector" else "receiver"} expression")
|
||||||
firReceiver = getAsFirExpression(it, "Incorrect receiver expression")
|
if (isEffectiveSelector) {
|
||||||
|
firSelector =
|
||||||
|
if (it.tokenType is KtNameReferenceExpressionElementType || it.tokenType == KtNodeTypes.CALL_EXPRESSION) {
|
||||||
|
firExpression
|
||||||
|
} else {
|
||||||
|
buildErrorExpression {
|
||||||
|
source = it.toFirSourceElement()
|
||||||
|
diagnostic = ConeSimpleDiagnostic(
|
||||||
|
"The expression cannot be a selector (occur after a dot)",
|
||||||
|
DiagnosticKind.IllegalSelector
|
||||||
|
)
|
||||||
|
expression = firExpression
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
firReceiver = firExpression
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -511,7 +529,11 @@ class ExpressionsConverter(
|
|||||||
@OptIn(FirImplementationDetail::class)
|
@OptIn(FirImplementationDetail::class)
|
||||||
it.replaceSource(dotQualifiedExpression.toFirSourceElement())
|
it.replaceSource(dotQualifiedExpression.toFirSourceElement())
|
||||||
}
|
}
|
||||||
return firSelector
|
|
||||||
|
return firSelector ?: buildErrorExpression(
|
||||||
|
null,
|
||||||
|
ConeSimpleDiagnostic("Qualified expression without selector", DiagnosticKind.Syntax)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -687,7 +709,7 @@ class ExpressionsConverter(
|
|||||||
buildWhenBranch {
|
buildWhenBranch {
|
||||||
source = entrySource
|
source = entrySource
|
||||||
condition = firCondition
|
condition = firCondition
|
||||||
result = branch
|
result = branch
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
val firCondition = entry.toFirWhenConditionWithoutSubject()
|
val firCondition = entry.toFirWhenConditionWithoutSubject()
|
||||||
|
|||||||
@@ -33,10 +33,7 @@ import org.jetbrains.kotlin.fir.scopes.FirScopeProvider
|
|||||||
import org.jetbrains.kotlin.fir.symbols.impl.*
|
import org.jetbrains.kotlin.fir.symbols.impl.*
|
||||||
import org.jetbrains.kotlin.fir.types.*
|
import org.jetbrains.kotlin.fir.types.*
|
||||||
import org.jetbrains.kotlin.fir.types.builder.*
|
import org.jetbrains.kotlin.fir.types.builder.*
|
||||||
import org.jetbrains.kotlin.fir.types.impl.ConeClassLikeTypeImpl
|
import org.jetbrains.kotlin.fir.types.impl.*
|
||||||
import org.jetbrains.kotlin.fir.types.impl.FirQualifierPartImpl
|
|
||||||
import org.jetbrains.kotlin.fir.types.impl.FirTypeArgumentListImpl
|
|
||||||
import org.jetbrains.kotlin.fir.types.impl.FirTypePlaceholderProjection
|
|
||||||
import org.jetbrains.kotlin.lexer.KtTokens.*
|
import org.jetbrains.kotlin.lexer.KtTokens.*
|
||||||
import org.jetbrains.kotlin.name.CallableId
|
import org.jetbrains.kotlin.name.CallableId
|
||||||
import org.jetbrains.kotlin.name.Name
|
import org.jetbrains.kotlin.name.Name
|
||||||
@@ -201,11 +198,37 @@ open class RawFirBuilder(
|
|||||||
private fun KtExpression?.toFirExpression(
|
private fun KtExpression?.toFirExpression(
|
||||||
errorReason: String,
|
errorReason: String,
|
||||||
kind: DiagnosticKind = DiagnosticKind.ExpressionExpected,
|
kind: DiagnosticKind = DiagnosticKind.ExpressionExpected,
|
||||||
): FirExpression =
|
): FirExpression {
|
||||||
if (stubMode) buildExpressionStub()
|
if (stubMode) {
|
||||||
else convertSafe() ?: buildErrorExpression(
|
return buildExpressionStub()
|
||||||
this?.toFirSourceElement(), ConeSimpleDiagnostic(errorReason, kind),
|
} else {
|
||||||
)
|
val result = this.convertSafe<FirExpression>()
|
||||||
|
if (result != null) {
|
||||||
|
if (this != null &&
|
||||||
|
this !is KtNameReferenceExpression &&
|
||||||
|
this !is KtCallExpression &&
|
||||||
|
this !is KtConstantExpression &&
|
||||||
|
getQualifiedExpressionForSelector() != null
|
||||||
|
) {
|
||||||
|
return buildErrorExpression {
|
||||||
|
source = toFirSourceElement()
|
||||||
|
diagnostic =
|
||||||
|
ConeSimpleDiagnostic(
|
||||||
|
"The expression cannot be a selector (occur after a dot)",
|
||||||
|
DiagnosticKind.IllegalSelector
|
||||||
|
)
|
||||||
|
expression = result
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
|
return buildErrorExpression(
|
||||||
|
this?.toFirSourceElement(), ConeSimpleDiagnostic(errorReason, kind),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private inline fun KtExpression.toFirStatement(errorReasonLazy: () -> String): FirStatement =
|
private inline fun KtExpression.toFirStatement(errorReasonLazy: () -> String): FirStatement =
|
||||||
convertSafe() ?: buildErrorExpression(this.toFirSourceElement(), ConeSimpleDiagnostic(errorReasonLazy(), DiagnosticKind.Syntax))
|
convertSafe() ?: buildErrorExpression(this.toFirSourceElement(), ConeSimpleDiagnostic(errorReasonLazy(), DiagnosticKind.Syntax))
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ enum class DiagnosticKind {
|
|||||||
UnresolvedLabel,
|
UnresolvedLabel,
|
||||||
NoThis,
|
NoThis,
|
||||||
IllegalConstExpression,
|
IllegalConstExpression,
|
||||||
|
IllegalSelector,
|
||||||
IllegalUnderscore,
|
IllegalUnderscore,
|
||||||
DeserializationError,
|
DeserializationError,
|
||||||
InferenceError,
|
InferenceError,
|
||||||
|
|||||||
@@ -70,9 +70,9 @@ fun main1() {
|
|||||||
|
|
||||||
1.<!UNRESOLVED_REFERENCE!>"sdf"<!>()
|
1.<!UNRESOLVED_REFERENCE!>"sdf"<!>()
|
||||||
|
|
||||||
1."sdf"
|
1.<!ILLEGAL_SELECTOR!>"sdf"<!>
|
||||||
1.{}
|
1.<!ILLEGAL_SELECTOR!>{}<!>
|
||||||
1.<!INVALID_IF_AS_EXPRESSION!>if<!> (true) {}
|
1.<!ILLEGAL_SELECTOR!><!INVALID_IF_AS_EXPRESSION!>if<!> (true) {}<!>
|
||||||
}
|
}
|
||||||
|
|
||||||
fun test() {
|
fun test() {
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
val receiver = { Int.(<!SYNTAX!><!>) <!SYNTAX!>-><!> }
|
val receiver = { Int.(<!SYNTAX!><!>) <!SYNTAX!>-><!> }
|
||||||
val receiverWithParameter = { Int.(<!UNRESOLVED_REFERENCE!>a<!>) <!SYNTAX!>-><!> }
|
val receiverWithParameter = { Int.<!ILLEGAL_SELECTOR!>(<!UNRESOLVED_REFERENCE!>a<!>)<!> <!SYNTAX!>-><!> }
|
||||||
|
|
||||||
val receiverAndReturnType = { Int.(<!SYNTAX!><!>)<!SYNTAX!>: Int -> 5<!> }
|
val receiverAndReturnType = { Int.(<!SYNTAX!><!>)<!SYNTAX!>: Int -> 5<!> }
|
||||||
val receiverAndReturnTypeWithParameter = { Int.(<!UNRESOLVED_REFERENCE!>a<!><!SYNTAX!><!SYNTAX!><!>: Int): Int -> 5<!> }
|
val receiverAndReturnTypeWithParameter = { Int.(<!UNRESOLVED_REFERENCE!>a<!><!SYNTAX!><!SYNTAX!><!>: Int): Int -> 5<!> }
|
||||||
|
|||||||
-29
@@ -1,29 +0,0 @@
|
|||||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
|
||||||
|
|
||||||
fun foo(x: Any) {
|
|
||||||
x.<!SYNTAX!><!>
|
|
||||||
val foo = 1
|
|
||||||
|
|
||||||
x.<!SYNTAX!><!>
|
|
||||||
fun bar() = 2
|
|
||||||
|
|
||||||
x.
|
|
||||||
fun String.() = 3
|
|
||||||
|
|
||||||
var a = 24.<!SYNTAX!><!>
|
|
||||||
var b = 42.0
|
|
||||||
}
|
|
||||||
|
|
||||||
class A {
|
|
||||||
val z = "a".<!SYNTAX!><!>
|
|
||||||
val x = 4
|
|
||||||
|
|
||||||
val y = "b".<!SYNTAX!><!>
|
|
||||||
fun baz() = 5
|
|
||||||
|
|
||||||
val q = "c".
|
|
||||||
fun String.() = 6
|
|
||||||
|
|
||||||
var a = 24.<!SYNTAX!><!>
|
|
||||||
var b = 42.0
|
|
||||||
}
|
|
||||||
+1
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||||
|
|
||||||
fun foo(x: Any) {
|
fun foo(x: Any) {
|
||||||
|
|||||||
+4
-4
@@ -1,8 +1,8 @@
|
|||||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION
|
// !DIAGNOSTICS: -UNUSED_EXPRESSION
|
||||||
|
|
||||||
fun test() {
|
fun test() {
|
||||||
"a"."b"::<!UNRESOLVED_REFERENCE!>foo<!>
|
"a".<!ILLEGAL_SELECTOR!>"b"<!>::<!UNRESOLVED_REFERENCE!>foo<!>
|
||||||
"a"."b"::class
|
"a".<!ILLEGAL_SELECTOR!>"b"<!>::class
|
||||||
"a"."b"."c"::<!UNRESOLVED_REFERENCE!>foo<!>
|
"a"."b".<!ILLEGAL_SELECTOR!>"c"<!>::<!UNRESOLVED_REFERENCE!>foo<!>
|
||||||
"a"."b"."c"::class
|
"a"."b".<!ILLEGAL_SELECTOR!>"c"<!>::class
|
||||||
}
|
}
|
||||||
|
|||||||
+6
@@ -291,6 +291,12 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
|
|||||||
token,
|
token,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
add(FirErrors.ILLEGAL_SELECTOR) { firDiagnostic ->
|
||||||
|
IllegalSelectorImpl(
|
||||||
|
firDiagnostic as FirPsiDiagnostic,
|
||||||
|
token,
|
||||||
|
)
|
||||||
|
}
|
||||||
add(FirErrors.SUPER_IS_NOT_AN_EXPRESSION) { firDiagnostic ->
|
add(FirErrors.SUPER_IS_NOT_AN_EXPRESSION) { firDiagnostic ->
|
||||||
SuperIsNotAnExpressionImpl(
|
SuperIsNotAnExpressionImpl(
|
||||||
firDiagnostic as FirPsiDiagnostic,
|
firDiagnostic as FirPsiDiagnostic,
|
||||||
|
|||||||
+4
@@ -226,6 +226,10 @@ sealed class KtFirDiagnostic<PSI: PsiElement> : KtDiagnosticWithPsi<PSI> {
|
|||||||
abstract val hasValueParameters: Boolean
|
abstract val hasValueParameters: Boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
|
abstract class IllegalSelector : KtFirDiagnostic<PsiElement>() {
|
||||||
|
override val diagnosticClass get() = IllegalSelector::class
|
||||||
|
}
|
||||||
|
|
||||||
abstract class SuperIsNotAnExpression : KtFirDiagnostic<PsiElement>() {
|
abstract class SuperIsNotAnExpression : KtFirDiagnostic<PsiElement>() {
|
||||||
override val diagnosticClass get() = SuperIsNotAnExpression::class
|
override val diagnosticClass get() = SuperIsNotAnExpression::class
|
||||||
}
|
}
|
||||||
|
|||||||
+7
@@ -338,6 +338,13 @@ internal class FunctionCallExpectedImpl(
|
|||||||
override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic)
|
override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal class IllegalSelectorImpl(
|
||||||
|
firDiagnostic: FirPsiDiagnostic,
|
||||||
|
override val token: ValidityToken,
|
||||||
|
) : KtFirDiagnostic.IllegalSelector(), KtAbstractFirDiagnostic<PsiElement> {
|
||||||
|
override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic)
|
||||||
|
}
|
||||||
|
|
||||||
internal class SuperIsNotAnExpressionImpl(
|
internal class SuperIsNotAnExpressionImpl(
|
||||||
firDiagnostic: FirPsiDiagnostic,
|
firDiagnostic: FirPsiDiagnostic,
|
||||||
override val token: ValidityToken,
|
override val token: ValidityToken,
|
||||||
|
|||||||
Reference in New Issue
Block a user