multiplatformUtil: Do not fail on non-physical classes from java

#KT-27907 Fixed
This commit is contained in:
Pavel V. Talanov
2018-10-30 15:01:48 +01:00
parent 5b6437876f
commit 02f5891ee0
@@ -119,7 +119,7 @@ private fun ModuleSourceInfo.toDescriptor() = KotlinCacheService.getInstance(mod
fun PsiElement.getPlatformModuleInfo(desiredPlatform: TargetPlatform): PlatformModuleInfo? {
assert(desiredPlatform != TargetPlatform.Common) { "Platform module cannot have Common platform" }
val moduleInfo = getModuleInfo() as? ModuleSourceInfo ?: return null
val moduleInfo = getNullableModuleInfo() as? ModuleSourceInfo ?: return null
return when (moduleInfo.platform) {
TargetPlatform.Common -> {
val correspondingImplementingModule = moduleInfo.module.implementingModules.map { it.toInfo(moduleInfo.sourceType) }