[FIR] Make resolution sequence of CallKind static field
This commit is contained in:
committed by
Mikhail Glukhikh
parent
53404e5dac
commit
98f75669a5
@@ -6,37 +6,28 @@
|
|||||||
package org.jetbrains.kotlin.fir.resolve.calls
|
package org.jetbrains.kotlin.fir.resolve.calls
|
||||||
|
|
||||||
sealed class CallKind {
|
sealed class CallKind {
|
||||||
abstract fun sequence(): List<ResolutionStage>
|
abstract val resolutionSequence: List<ResolutionStage>
|
||||||
|
|
||||||
object Function : CallKind() {
|
object Function : CallKind() {
|
||||||
override fun sequence(): List<ResolutionStage> {
|
override val resolutionSequence: List<ResolutionStage> = listOf(
|
||||||
return functionCallResolutionSequence()
|
CheckVisibility,
|
||||||
}
|
MapArguments,
|
||||||
|
CheckExplicitReceiverConsistency,
|
||||||
|
CreateFreshTypeVariableSubstitutorStage,
|
||||||
|
CheckReceivers.Dispatch,
|
||||||
|
CheckReceivers.Extension,
|
||||||
|
CheckArguments
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
object VariableAccess : CallKind() {
|
object VariableAccess : CallKind() {
|
||||||
override fun sequence(): List<ResolutionStage> {
|
override val resolutionSequence: List<ResolutionStage> = listOf(
|
||||||
return qualifiedAccessResolutionSequence()
|
CheckVisibility,
|
||||||
}
|
DiscriminateSynthetics,
|
||||||
|
CheckExplicitReceiverConsistency,
|
||||||
|
CreateFreshTypeVariableSubstitutorStage,
|
||||||
|
CheckReceivers.Dispatch,
|
||||||
|
CheckReceivers.Extension
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal fun functionCallResolutionSequence() = listOf(
|
|
||||||
CheckVisibility,
|
|
||||||
MapArguments,
|
|
||||||
CheckExplicitReceiverConsistency,
|
|
||||||
CreateFreshTypeVariableSubstitutorStage,
|
|
||||||
CheckReceivers.Dispatch,
|
|
||||||
CheckReceivers.Extension,
|
|
||||||
CheckArguments
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
internal fun qualifiedAccessResolutionSequence() = listOf(
|
|
||||||
CheckVisibility,
|
|
||||||
DiscriminateSynthetics,
|
|
||||||
CheckExplicitReceiverConsistency,
|
|
||||||
CreateFreshTypeVariableSubstitutorStage,
|
|
||||||
CheckReceivers.Dispatch,
|
|
||||||
CheckReceivers.Extension
|
|
||||||
)
|
|
||||||
+1
-1
@@ -16,7 +16,7 @@ class ResolutionStageRunner(val components: InferenceComponents) {
|
|||||||
val sink = CheckerSinkImpl(components)
|
val sink = CheckerSinkImpl(components)
|
||||||
var finished = false
|
var finished = false
|
||||||
sink.continuation = suspend {
|
sink.continuation = suspend {
|
||||||
for (stage in candidate.callInfo.callKind.sequence()) {
|
for (stage in candidate.callInfo.callKind.resolutionSequence) {
|
||||||
stage.check(candidate, sink, candidate.callInfo)
|
stage.check(candidate, sink, candidate.callInfo)
|
||||||
}
|
}
|
||||||
}.createCoroutineUnintercepted(completion = object : Continuation<Unit> {
|
}.createCoroutineUnintercepted(completion = object : Continuation<Unit> {
|
||||||
|
|||||||
Reference in New Issue
Block a user