Make ModuleDescriptor#getPackage() return not null lazy object with lazy scope

Refactor: no need to create package view in order to obtain its subpackages
LazyPackageViewDescriptorImpl to replace PackageViewDescriptorImpl
This allows to avoid computations when package views are requested but their contents not necessarily queried
For example: DescriptorResolver.resolvePackageHeader()
This commit is contained in:
Pavel V. Talanov
2015-05-07 19:43:17 +03:00
parent 1cf38e4799
commit 37bcd455b5
40 changed files with 103 additions and 105 deletions
@@ -108,7 +108,7 @@ public class BuiltInsSerializer(private val dependOnOldBuiltIns: Boolean) {
}
private fun serializePackage(module: ModuleDescriptor, fqName: FqName, destDir: File) {
val packageView = module.getPackage(fqName) ?: error("No package resolved in $module")
val packageView = module.getPackage(fqName)
// TODO: perform some kind of validation? At the moment not possible because DescriptorValidator is in compiler-tests
// DescriptorValidator.validate(packageView)