mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 11:21:05 +01:00
Add import support for remaining decl types. (#3651)
I'd excluded these initially just because I was thinking towards copies, but under the current model I'm trying to catch all the decl types just for consistency. Note references will still be a TODO error (LazyImportRef is already tested for this, it just didn't feel necessary to add individual tests while I try to sort out behavior). Fixes an oversight where declarations in an entity's scope were being added to the list of exports. Note I'm trimming some Import API arguments as now-unused.
This commit is contained in:
@@ -83,7 +83,13 @@ auto DeclNameStack::LookupOrAddName(NameContext name_context,
|
||||
QualifiedDeclOutsideScopeEntity);
|
||||
}
|
||||
}
|
||||
context_->AddExport(target_id);
|
||||
|
||||
// Exports are only tracked when the declaration is at the file-level
|
||||
// scope. Otherwise, it's in some other entity, such as a class.
|
||||
if (name_context.enclosing_scope == ScopeIndex::Package) {
|
||||
context_->AddExport(target_id);
|
||||
}
|
||||
|
||||
auto [_, success] = name_scope.names.insert(
|
||||
{name_context.unresolved_name_id, target_id});
|
||||
CARBON_CHECK(success)
|
||||
|
||||
Reference in New Issue
Block a user