multiplatformUtil: Do not fail on non-physical classes from java
#KT-27907 Fixed
This commit is contained in:
+1
-1
@@ -119,7 +119,7 @@ private fun ModuleSourceInfo.toDescriptor() = KotlinCacheService.getInstance(mod
|
|||||||
|
|
||||||
fun PsiElement.getPlatformModuleInfo(desiredPlatform: TargetPlatform): PlatformModuleInfo? {
|
fun PsiElement.getPlatformModuleInfo(desiredPlatform: TargetPlatform): PlatformModuleInfo? {
|
||||||
assert(desiredPlatform != TargetPlatform.Common) { "Platform module cannot have Common platform" }
|
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) {
|
return when (moduleInfo.platform) {
|
||||||
TargetPlatform.Common -> {
|
TargetPlatform.Common -> {
|
||||||
val correspondingImplementingModule = moduleInfo.module.implementingModules.map { it.toInfo(moduleInfo.sourceType) }
|
val correspondingImplementingModule = moduleInfo.module.implementingModules.map { it.toInfo(moduleInfo.sourceType) }
|
||||||
|
|||||||
Reference in New Issue
Block a user