From e81479e30bcedc821a1c2c23c6edfcc2c4fee787 Mon Sep 17 00:00:00 2001 From: Dmitriy Dolovov Date: Mon, 23 Mar 2020 20:17:48 +0700 Subject: [PATCH] KLIB: Avoid check for KLIBs w/o components for other platforms than Native --- .../src/org/jetbrains/kotlin/idea/klib/utils.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 {