Code cleanup: type parameters can have in / out variance
This commit is contained in:
+2
-2
@@ -27,14 +27,14 @@ import org.jetbrains.kotlin.resolve.scopes.receivers.ReceiverValue
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.check
|
||||
|
||||
|
||||
class KnownResultProcessor<C>(
|
||||
class KnownResultProcessor<out C>(
|
||||
val result: Collection<C>
|
||||
): ScopeTowerProcessor<C> {
|
||||
override fun process(data: TowerData)
|
||||
= if (data == TowerData.Empty) listOfNotNull(result.check { it.isNotEmpty() }) else emptyList()
|
||||
}
|
||||
|
||||
class CompositeScopeTowerProcessor<C>(
|
||||
class CompositeScopeTowerProcessor<out C>(
|
||||
vararg val processors: ScopeTowerProcessor<C>
|
||||
) : ScopeTowerProcessor<C> {
|
||||
override fun process(data: TowerData): List<Collection<C>> = processors.flatMap { it.process(data) }
|
||||
|
||||
@@ -38,7 +38,7 @@ interface Candidate<out D : CallableDescriptor> {
|
||||
val status: ResolutionCandidateStatus
|
||||
}
|
||||
|
||||
interface TowerContext<D : CallableDescriptor, C: Candidate<D>> {
|
||||
interface TowerContext<D : CallableDescriptor, out C: Candidate<D>> {
|
||||
val name: Name
|
||||
val scopeTower: ScopeTower
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ val CandidateWithBoundDispatchReceiver<*>.requiresExtensionReceiver: Boolean
|
||||
|
||||
fun DataFlowDecorator.getAllPossibleTypes(receiver: ReceiverValue) = getSmartCastTypes(receiver) + receiver.type
|
||||
|
||||
internal class CandidateWithBoundDispatchReceiverImpl<D : CallableDescriptor>(
|
||||
internal class CandidateWithBoundDispatchReceiverImpl<out D : CallableDescriptor>(
|
||||
override val dispatchReceiver: ReceiverValue?,
|
||||
override val descriptor: D,
|
||||
override val diagnostics: List<ResolutionDiagnostic>
|
||||
|
||||
Reference in New Issue
Block a user