TypeAccessibilityCheckerImpl: explicitParameters change return type to Sequence
This commit is contained in:
+7
-17
@@ -105,7 +105,7 @@ private fun DeclarationDescriptor.collectAllTypes(): Sequence<FqName?> {
|
|||||||
is CallableDescriptor -> {
|
is CallableDescriptor -> {
|
||||||
val returnType = returnType ?: return sequenceOf(null)
|
val returnType = returnType ?: return sequenceOf(null)
|
||||||
returnType.collectAllTypes() +
|
returnType.collectAllTypes() +
|
||||||
explicitParameters.asSequence().map(ParameterDescriptor::getType).flatMap(KotlinType::collectAllTypes) +
|
explicitParameters.map(ParameterDescriptor::getType).flatMap(KotlinType::collectAllTypes) +
|
||||||
typeParameters.asSequence().flatMap(DeclarationDescriptor::collectAllTypes)
|
typeParameters.asSequence().flatMap(DeclarationDescriptor::collectAllTypes)
|
||||||
}
|
}
|
||||||
is TypeParameterDescriptor -> {
|
is TypeParameterDescriptor -> {
|
||||||
@@ -130,19 +130,9 @@ private fun KotlinType.collectAllTypes(): Sequence<FqName?> = sequenceOf(fqName)
|
|||||||
.map(TypeProjection::getType)
|
.map(TypeProjection::getType)
|
||||||
.flatMap(KotlinType::collectAllTypes)
|
.flatMap(KotlinType::collectAllTypes)
|
||||||
|
|
||||||
private val CallableDescriptor.explicitParameters: List<ParameterDescriptor>
|
private val CallableDescriptor.explicitParameters: Sequence<ParameterDescriptor>
|
||||||
get() {
|
get() = valueParameters.asSequence() + dispatchReceiverParameter?.let {
|
||||||
val result = ArrayList<ParameterDescriptor>(valueParameters.size + 2)
|
sequenceOf(it)
|
||||||
|
}.orEmpty() + extensionReceiverParameter?.let {
|
||||||
this.dispatchReceiverParameter?.let {
|
sequenceOf(it)
|
||||||
result.add(it)
|
}.orEmpty()
|
||||||
}
|
|
||||||
|
|
||||||
this.extensionReceiverParameter?.let {
|
|
||||||
result.add(it)
|
|
||||||
}
|
|
||||||
|
|
||||||
result.addAll(valueParameters)
|
|
||||||
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user