Remove CandidateWithBoundDispatchReceiverImpl

Interface CandidateWithBoundDispatchReceiver had a unique
implementation, which was private.

Turned interface CandidateWithBoundDispatchReceiver into a
class. Removed CandidateWithBoundDispatchReceiverImpl. Removed
string "Impl" suffix at constructor call sites.
This commit is contained in:
Cuihtlauac ALVARADO
2018-09-11 17:33:22 +02:00
committed by Dmitry Savvinov
parent 2791a679aa
commit ece745966b
4 changed files with 6 additions and 14 deletions
@@ -54,13 +54,11 @@ interface ScopeTowerLevel {
fun recordLookup(name: Name)
}
interface CandidateWithBoundDispatchReceiver {
val descriptor: CallableDescriptor
class CandidateWithBoundDispatchReceiver(
val dispatchReceiver: ReceiverValueWithSmartCastInfo?,
val descriptor: CallableDescriptor,
val diagnostics: List<ResolutionDiagnostic>
val dispatchReceiver: ReceiverValueWithSmartCastInfo?
}
)
fun getResultApplicability(diagnostics: Collection<KotlinCallDiagnostic>) =
diagnostics.maxBy { it.candidateApplicability }?.candidateApplicability
@@ -214,7 +214,7 @@ private fun ImplicitScopeTower.getExtensionInvokeCandidateDescriptor(
?: error("No single synthesized invoke for $invokeDescriptor: $synthesizedInvokes")
// here we don't add SynthesizedDescriptor diagnostic because it should has priority as member
return CandidateWithBoundDispatchReceiverImpl(extensionFunctionReceiver, synthesizedInvoke, listOf())
return CandidateWithBoundDispatchReceiver(extensionFunctionReceiver, synthesizedInvoke, listOf())
}
// case 1.(foo())() or (foo())()
@@ -72,7 +72,7 @@ internal abstract class AbstractScopeTowerLevel(
)?.let { diagnostics.add(VisibilityError(it)) }
}
}
return CandidateWithBoundDispatchReceiverImpl(dispatchReceiver, descriptor, diagnostics)
return CandidateWithBoundDispatchReceiver(dispatchReceiver, descriptor, diagnostics)
}
}
@@ -38,12 +38,6 @@ val CandidateWithBoundDispatchReceiver.requiresExtensionReceiver: Boolean
val ResolutionCandidateApplicability.isInapplicable: Boolean
get() = this in INAPPLICABLE_STATUSES
internal class CandidateWithBoundDispatchReceiverImpl(
override val dispatchReceiver: ReceiverValueWithSmartCastInfo?,
override val descriptor: CallableDescriptor,
override val diagnostics: List<ResolutionDiagnostic>
) : CandidateWithBoundDispatchReceiver
fun <C : Candidate> C.forceResolution(): C {
resultingApplicability
return this