diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/expectactual/TypeAccessibilityCheckerImpl.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/expectactual/TypeAccessibilityCheckerImpl.kt index a9507598254..87f2527b1d4 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/expectactual/TypeAccessibilityCheckerImpl.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/expectactual/TypeAccessibilityCheckerImpl.kt @@ -95,7 +95,9 @@ private fun DeclarationDescriptor.collectAllTypes(): Sequence { } + declaredTypeParameters.asSequence().flatMap(DeclarationDescriptor::collectAllTypes) + sequenceOf(fqNameOrNull()) is CallableDescriptor -> { 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 -> { val upperBounds = upperBounds diff --git a/idea/testData/multiModuleQuickFix/createExpect/funWithInaccessibleBounds/jvm/Utils.kt b/idea/testData/multiModuleQuickFix/createExpect/funWithInaccessibleBounds/jvm/Utils.kt index 3c2ce98cce3..55b40540205 100644 --- a/idea/testData/multiModuleQuickFix/createExpect/funWithInaccessibleBounds/jvm/Utils.kt +++ b/idea/testData/multiModuleQuickFix/createExpect/funWithInaccessibleBounds/jvm/Utils.kt @@ -1,5 +1,5 @@ // "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){...} // DISABLE-ERRORS interface Some diff --git a/idea/testData/multiModuleQuickFix/createExpect/funWithInaccessibleBounds/jvm/Utils.kt.after b/idea/testData/multiModuleQuickFix/createExpect/funWithInaccessibleBounds/jvm/Utils.kt.after index 3a1e543d6b0..208d2d8111e 100644 --- a/idea/testData/multiModuleQuickFix/createExpect/funWithInaccessibleBounds/jvm/Utils.kt.after +++ b/idea/testData/multiModuleQuickFix/createExpect/funWithInaccessibleBounds/jvm/Utils.kt.after @@ -1,5 +1,5 @@ // "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){...} // DISABLE-ERRORS interface Some