Fix PackageFragmentProvider#isEmpty(FqName) for REPL
This commit is contained in:
committed by
TeamCityServer
parent
bcaad7487f
commit
613eda5016
+2
@@ -39,6 +39,8 @@ open class LazyPackageViewDescriptorImpl(
|
|||||||
module.packageFragmentProvider.isEmpty(fqName)
|
module.packageFragmentProvider.isEmpty(fqName)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun isEmpty(): Boolean = empty
|
||||||
|
|
||||||
override val memberScope: MemberScope = LazyScopeAdapter(storageManager) {
|
override val memberScope: MemberScope = LazyScopeAdapter(storageManager) {
|
||||||
if (isEmpty()) {
|
if (isEmpty()) {
|
||||||
MemberScope.Empty
|
MemberScope.Empty
|
||||||
|
|||||||
+6
@@ -10,6 +10,7 @@ import org.jetbrains.kotlin.descriptors.PackageViewDescriptor
|
|||||||
import org.jetbrains.kotlin.descriptors.impl.LazyPackageViewDescriptorImpl
|
import org.jetbrains.kotlin.descriptors.impl.LazyPackageViewDescriptorImpl
|
||||||
import org.jetbrains.kotlin.descriptors.impl.ModuleDescriptorImpl
|
import org.jetbrains.kotlin.descriptors.impl.ModuleDescriptorImpl
|
||||||
import org.jetbrains.kotlin.descriptors.impl.PackageViewDescriptorFactory
|
import org.jetbrains.kotlin.descriptors.impl.PackageViewDescriptorFactory
|
||||||
|
import org.jetbrains.kotlin.descriptors.isEmpty
|
||||||
import org.jetbrains.kotlin.descriptors.packageFragments
|
import org.jetbrains.kotlin.descriptors.packageFragments
|
||||||
import org.jetbrains.kotlin.name.FqName
|
import org.jetbrains.kotlin.name.FqName
|
||||||
import org.jetbrains.kotlin.storage.StorageManager
|
import org.jetbrains.kotlin.storage.StorageManager
|
||||||
@@ -34,4 +35,9 @@ class ReplPackageViewDescriptor(
|
|||||||
if (calculatedFragments.isNotEmpty()) cachedFragments = calculatedFragments
|
if (calculatedFragments.isNotEmpty()) cachedFragments = calculatedFragments
|
||||||
return calculatedFragments
|
return calculatedFragments
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun isEmpty(): Boolean {
|
||||||
|
cachedFragments?.let { return it.isEmpty() }
|
||||||
|
return module.packageFragmentProvider.isEmpty(fqName)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user