mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Add 'let' handling for ImportRefUsed. (#3700)
- File::StringifyTypeExpr now has a case that hits the ImportRefUsed TODO, so implementing that. I think the `static` approach will be helpful in ensuring there aren't access bugs, particularly when future support is added. - `let` wasn't adding to exports because it doesn't use `decl_name_stack` the way `var` does. This now adds to exports, but we might want to unify logic for issues such as this. - BuildImportRefUsedValueRepr is now called for another inst kind, and it seemed like calling back to BuildValueRepr was the best way to resolve this. I don't *think* that's going to cause recursion.
This commit is contained in:
@@ -21,9 +21,10 @@ static auto GetImportName(const SemIR::File& import_sem_ir,
|
||||
SemIR::Inst import_inst)
|
||||
-> std::pair<SemIR::NameId, SemIR::NameScopeId> {
|
||||
switch (import_inst.kind()) {
|
||||
case SemIR::InstKind::BindName: {
|
||||
case SemIR::InstKind::BindName:
|
||||
case SemIR::InstKind::BindSymbolicName: {
|
||||
const auto& bind_name = import_sem_ir.bind_names().Get(
|
||||
import_inst.As<SemIR::BindName>().bind_name_id);
|
||||
import_inst.As<SemIR::AnyBindName>().bind_name_id);
|
||||
return {bind_name.name_id, bind_name.enclosing_scope_id};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user