diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/klib/utils.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/klib/utils.kt index cba85095980..8750b11bab4 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/klib/utils.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/klib/utils.kt @@ -40,9 +40,13 @@ fun VirtualFile.isKlibLibraryRootForPlatform(targetPlatform: TargetPlatform): Bo // run check for library root too // this is necessary to recognize old style KLIBs that do not have components, and report tem to user appropriately + // (relevant only for Kotlin/Native KLIBs) val requestedBuiltInsPlatform = targetPlatform.toBuiltInsPlatform() - return checkKlibComponent(this, requestedBuiltInsPlatform) || - children?.any { checkKlibComponent(it, requestedBuiltInsPlatform) } == true + if (requestedBuiltInsPlatform == BuiltInsPlatform.NATIVE && checkKlibComponent(this, requestedBuiltInsPlatform)) { + return true + } + + return children?.any { checkKlibComponent(it, requestedBuiltInsPlatform) } == true } private fun checkKlibComponent(componentFile: VirtualFile, requestedBuiltInsPlatform: BuiltInsPlatform): Boolean {