mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Use the list of extensions of a nominal type for name lookup into that type.
This replaces the obscure, inefficient lookup into extensions with something more straightforward: walk all of the known extensions (available as a simple list), then eliminate any declarations that have been shadowed by other declarations. The shadowing rules still need to consider the module re-export DAG, but we'll leave that for later. As part of this, keep track of the last time we loaded extensions for a given nominal type. If the list of extensions is out-of-date with respect to the global generation count (which tracks resolved module imports), ask the modules to load any additional extensions. Only the Clang module importer can currently load extensions in this manner. Swift SVN r5223
This commit is contained in:
@@ -121,3 +121,9 @@ Module *SourceLoader::loadModule(
|
||||
|
||||
return importTU;
|
||||
}
|
||||
|
||||
void SourceLoader::loadExtensions(NominalTypeDecl *nominal,
|
||||
unsigned previousGeneration) {
|
||||
// Type-checking the source automatically loads all extensions; there's
|
||||
// nothing to do here.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user