mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 11:51:04 +01:00
Allocate de Bruijn levels to symbolic bindings. (#3906)
Use a level comparison during substitution to determine whether we're substituting a particular binding. Evaluate symbolic bindings with the same name and the same level to the same symbolic constant, for example across redeclarations of a generic function.
This commit is contained in:
@@ -19,6 +19,10 @@ auto ScopeStack::Push(SemIR::InstId scope_inst_id, SemIR::NameScopeId scope_id,
|
||||
{.index = next_scope_index_,
|
||||
.scope_inst_id = scope_inst_id,
|
||||
.scope_id = scope_id,
|
||||
.next_compile_time_bind_index =
|
||||
scope_stack_.empty()
|
||||
? SemIR::CompileTimeBindIndex(0)
|
||||
: scope_stack_.back().next_compile_time_bind_index,
|
||||
.lexical_lookup_has_load_error =
|
||||
LexicalLookupHasLoadError() || lexical_lookup_has_load_error});
|
||||
if (scope_id.is_valid()) {
|
||||
|
||||
Reference in New Issue
Block a user