FIR [IDE]: provide correct node phase when necessary

This commit is contained in:
Ilya Kirillov
2020-07-30 17:38:11 +03:00
committed by Mikhail Glukhikh
parent 119302b016
commit b1d3ab04c2
4 changed files with 8 additions and 2 deletions

View File

@@ -68,10 +68,14 @@ internal fun FirScope.processFunctionsAndConstructorsByName(
processConstructorsByName(
name, session, bodyResolveComponents,
includeInnerConstructors = includeInnerConstructors,
processor = processor
processor = {
with(bodyResolveComponents) { it.phasedFir }
processor(it)
}
)
processFunctionsByName(name) {
with(bodyResolveComponents) { it.phasedFir }
processor(it)
}
}

View File

@@ -15,6 +15,7 @@ import kotlin.coroutines.resume
class ResolutionStageRunner(val components: InferenceComponents) {
fun processCandidate(candidate: Candidate, stopOnFirstError: Boolean = true): CandidateApplicability {
val sink = CheckerSinkImpl(components, stopOnFirstError = stopOnFirstError)
with (candidate.bodyResolveComponents) { candidate.symbol.phasedFir }
var finished = false
sink.continuation = suspend {
candidate.callInfo.callKind.resolutionSequence.forEachIndexed { index, stage ->

View File

@@ -183,6 +183,7 @@ private class TowerScopeLevelProcessor(
implicitExtensionReceiverValue: ImplicitReceiverValue<*>?,
builtInExtensionFunctionReceiverValue: ReceiverValue?
) {
with(candidateFactory.bodyResolveComponents) { symbol.phasedFir }
// Check explicit extension receiver for default package members
if (symbol is FirNamedFunctionSymbol && dispatchReceiverValue == null &&
(implicitExtensionReceiverValue == null) != (explicitReceiver == null) &&

View File

@@ -87,7 +87,7 @@ class MemberScopeTowerLevel(
if (candidate is FirCallableSymbol<*> &&
(implicitExtensionInvokeMode || candidate.hasConsistentExtensionReceiver(extensionReceiver))
) {
val fir = candidate.fir
val fir = with(bodyResolveComponents) { candidate.phasedFir }
if ((fir as? FirConstructor)?.isInner == false) {
return@processScopeMembers
}