Use NodeId for Binding source (#4234)

This commit is contained in:
Charlie Marsh
2023-05-06 12:20:08 -04:00
committed by GitHub
parent c1f0661225
commit a9fc648faf
7 changed files with 97 additions and 96 deletions

View File

@@ -252,7 +252,9 @@ impl<'a> Context<'a> {
.take(scope_index)
.all(|scope| scope.get(name).is_none())
{
return Some((binding.source.unwrap(), format!("{name}.{member}")));
if let Some(source) = binding.source {
return Some((self.stmts[source], format!("{name}.{member}")));
}
}
}
}
@@ -268,7 +270,9 @@ impl<'a> Context<'a> {
.take(scope_index)
.all(|scope| scope.get(name).is_none())
{
return Some((binding.source.unwrap(), (*name).to_string()));
if let Some(source) = binding.source {
return Some((self.stmts[source], (*name).to_string()));
}
}
}
}
@@ -283,7 +287,9 @@ impl<'a> Context<'a> {
.take(scope_index)
.all(|scope| scope.get(name).is_none())
{
return Some((binding.source.unwrap(), format!("{name}.{member}")));
if let Some(source) = binding.source {
return Some((self.stmts[source], format!("{name}.{member}")));
}
}
}
}