TypeAccessibilityChecker: fix callable with upper bound
This commit is contained in:
+3
-1
@@ -95,7 +95,9 @@ private fun DeclarationDescriptor.collectAllTypes(): Sequence<FqName?> {
|
|||||||
} + declaredTypeParameters.asSequence().flatMap(DeclarationDescriptor::collectAllTypes) + sequenceOf(fqNameOrNull())
|
} + declaredTypeParameters.asSequence().flatMap(DeclarationDescriptor::collectAllTypes) + sequenceOf(fqNameOrNull())
|
||||||
is CallableDescriptor -> {
|
is CallableDescriptor -> {
|
||||||
val returnType = returnType ?: return sequenceOf(null)
|
val returnType = returnType ?: return sequenceOf(null)
|
||||||
returnType.collectAllTypes() + explicitParameters.asSequence().map(ParameterDescriptor::getType).flatMap(KotlinType::collectAllTypes)
|
returnType.collectAllTypes() +
|
||||||
|
explicitParameters.asSequence().map(ParameterDescriptor::getType).flatMap(KotlinType::collectAllTypes) +
|
||||||
|
typeParameters.asSequence().flatMap(DeclarationDescriptor::collectAllTypes)
|
||||||
}
|
}
|
||||||
is TypeParameterDescriptor -> {
|
is TypeParameterDescriptor -> {
|
||||||
val upperBounds = upperBounds
|
val upperBounds = upperBounds
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
// "Create expected function in common module testModule_Common" "true"
|
// "Create expected function in common module testModule_Common" "true"
|
||||||
// SHOULD_FAIL_WITH: Cannot generate expected function: Type Some is not accessible from common code
|
// SHOULD_FAIL_WITH: You cannot create the expect declaration from:,fun foo(some: List<T>){...}
|
||||||
// DISABLE-ERRORS
|
// DISABLE-ERRORS
|
||||||
|
|
||||||
interface Some
|
interface Some
|
||||||
|
|||||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
// "Create expected function in common module testModule_Common" "true"
|
// "Create expected function in common module testModule_Common" "true"
|
||||||
// SHOULD_FAIL_WITH: Cannot generate expected function: Type Some is not accessible from common code
|
// SHOULD_FAIL_WITH: You cannot create the expect declaration from:,fun foo(some: List<T>){...}
|
||||||
// DISABLE-ERRORS
|
// DISABLE-ERRORS
|
||||||
|
|
||||||
interface Some
|
interface Some
|
||||||
|
|||||||
Reference in New Issue
Block a user