Fix clang_decls InstId for generic class export (#7633)

The exported class was being inserted with a type inst ID as the key
(and looked up that way elsewhere), but when checking if the generic
class was already exported, the `first_decl_id` was being used. Make it
consistent, and opt for `first_decl_id` everywhere since it provides a
better location for diagnostics.
This commit is contained in:
Nicholas Bishop
2026-08-13 17:30:20 +00:00
committed by GitHub
parent 4ea5ef45dd
commit 2784f33221
4 changed files with 22 additions and 17 deletions
+1 -1
View File
@@ -238,7 +238,7 @@ auto CarbonExternalASTSource::MapInstIdToClangDeclOrType(LookupResult lookup)
} else if (auto generic_class =
context_->insts().TryGetAs<SemIR::GenericClassType>(
type_inst_id)) {
return ExportGenericClassToCpp(*context_, type_inst_id, *generic_class);
return ExportGenericClassToCpp(*context_, *generic_class);
}
return nullptr;