mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Switch import logic to rely on constants. (#3917)
Breaks extern handling, makes other things work. TODOs in import_ref for extern, the tests need rewritten too under the new model.
This commit is contained in:
@@ -326,7 +326,7 @@ static auto LookupInImportIRScopes(Context& context, SemIRLoc loc,
|
||||
auto import_inst_id =
|
||||
AddImportRef(context, {.ir_id = import_ir_id, .inst_id = it->second});
|
||||
if (result_id.is_valid()) {
|
||||
MergeImportRef(context, import_inst_id, result_id);
|
||||
context.DiagnoseDuplicateName(import_inst_id, result_id);
|
||||
} else {
|
||||
LoadImportRef(context, import_inst_id,
|
||||
mark_imports_used ? loc : SemIR::LocId::Invalid);
|
||||
|
||||
Reference in New Issue
Block a user