FIR: make ConeVariableExpectedError an object

This commit is contained in:
Tianyu Geng
2021-09-16 20:34:25 -07:00
committed by TeamCityServer
parent 9b9c51bc8d
commit 1b6fa4303f
2 changed files with 2 additions and 2 deletions
@@ -131,7 +131,7 @@ class ConeOperatorAmbiguityError(override val candidateSymbols: Collection<FirBa
override val reason: String get() = "Operator overload ambiguity. Compatible candidates: ${candidateSymbols.map { describeSymbol(it) }}"
}
class ConeVariableExpectedError : ConeDiagnostic {
object ConeVariableExpectedError : ConeDiagnostic {
override val reason: String get() = "Variable expected"
}
@@ -528,7 +528,7 @@ open class FirExpressionsResolveTransformer(transformer: FirBodyResolveTransform
leftArgument.calleeReference.source
else -> leftArgument.source
}
diagnostic = if (lhsSymbol == null) ConeVariableExpectedError() else ConeValReassignmentError(lhsSymbol)
diagnostic = if (lhsSymbol == null) ConeVariableExpectedError else ConeValReassignmentError(lhsSymbol)
}
}
(leftArgument as? FirQualifiedAccess)?.let {