From fcff1c2ddc8e72ef2f888e84d83a0bc5ab343060 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Tue, 4 Jul 2023 15:15:15 +0300 Subject: [PATCH] [FIR] Remove meaningless check from FirDoubleColonExpressionResolver In FIR `FirFunctionCall` is created only for real function calls --- .../fir/resolve/FirDoubleColonExpressionResolver.kt | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/FirDoubleColonExpressionResolver.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/FirDoubleColonExpressionResolver.kt index 09d77cd97c2..790e1a0994d 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/FirDoubleColonExpressionResolver.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/FirDoubleColonExpressionResolver.kt @@ -35,11 +35,6 @@ sealed class DoubleColonLHS(val type: ConeKotlinType) { class Type(type: ConeKotlinType) : DoubleColonLHS(type) } - -// Returns true if this expression has the form "A" which means it's a type on the LHS of a double colon expression -internal val FirFunctionCall.hasExplicitValueArguments: Boolean - get() = arguments.isNotEmpty() - class FirDoubleColonExpressionResolver(private val session: FirSession) { // Returns true if the expression is not a call expression without value arguments (such as "A") or a qualified expression @@ -48,7 +43,6 @@ class FirDoubleColonExpressionResolver(private val session: FirSession) { private fun FirExpression.canBeConsideredProperExpression(): Boolean { return when { this is FirQualifiedAccessExpression && explicitReceiver?.canBeConsideredProperExpression() != true -> false - this is FirFunctionCall && !hasExplicitValueArguments -> false else -> true } } @@ -56,7 +50,7 @@ class FirDoubleColonExpressionResolver(private val session: FirSession) { private fun FirExpression.canBeConsideredProperType(): Boolean { return when { this is FirFunctionCall && - explicitReceiver?.canBeConsideredProperType() != false -> !hasExplicitValueArguments + explicitReceiver?.canBeConsideredProperType() != false -> false this is FirQualifiedAccessExpression && explicitReceiver?.canBeConsideredProperType() != false && calleeReference is FirNamedReference -> true