[FIR] Remove redundant resolution stage from resolution of synthetic function calls

This commit is contained in:
Dmitriy Novozhilov
2019-09-10 12:04:57 +03:00
parent ef5ac7df93
commit 6a75a9072c
2 changed files with 13 additions and 1 deletions
@@ -8,6 +8,18 @@ package org.jetbrains.kotlin.fir.resolve.calls
sealed class CallKind {
abstract val resolutionSequence: List<ResolutionStage>
/*
* Used for resolution of synthetic calls for `when` and `try` expression
* that are equal to `fun <K> select(vararg values: K): K`
*/
object SyntheticSelect : CallKind() {
override val resolutionSequence: List<ResolutionStage> = listOf(
MapArguments,
CreateFreshTypeVariableSubstitutorStage,
CheckArguments
)
}
object Function : CallKind() {
override val resolutionSequence: List<ResolutionStage> = listOf(
CheckVisibility,
@@ -95,7 +95,7 @@ class FirSyntheticCallGenerator(private val transformer: FirBodyResolveTransform
)
private fun generateCallInfo(arguments: List<FirExpression>) = CallInfo(
callKind = CallKind.Function,
callKind = CallKind.SyntheticSelect,
explicitReceiver = null,
arguments = arguments,
isSafeCall = false,