mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Don't re-require complete types for extended scopes (#7194)
When an outer type defines an `extend` relationship to an inner type, we require that inner type to be complete so that we can know that name lookup can search both scopes as soon as the outer type is complete. When doing name lookup, we require the type in which we are looking to be complete. Then, we recursively add extended scopes, but then also require each of them to be complete again, which inserts RequireCompleteType instructions into the block doing lookup. While these new instructions may differ in terms of their specifics, they are redundant since we already required the type to be complete, and specifics can not change the completeness of a type. They are also problematic because a named constraint or interface can extend a scope with a symbolic specific, by using `Self` as an argument. This inserts a symbolic instruction into the block doing name lookup, even though that block may not be generic.
This commit is contained in:
@@ -491,7 +491,7 @@ auto CarbonExternalASTSource::FindExternalVisibleDeclsByName(
|
||||
if (!AppendLookupScopesForConstant(
|
||||
*context_, SemIR::LocId::None,
|
||||
context_->constant_values().Get(decl_context_inst_id),
|
||||
SemIR::ConstantId::None, &lookup_scopes)) {
|
||||
SemIR::ConstantId::None, /*extended_scope=*/false, &lookup_scopes)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user