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:
Jon Ross-Perkins
2024-04-29 21:33:47 +00:00
committed by GitHub
parent c82ce8faae
commit 6483044597
13 changed files with 910 additions and 569 deletions
+1 -1
View File
@@ -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);