Only allow unaliasing in current scope, add tests (#3936)

* unalias only removes aliases in the current scope

* Add a test and fix previous ones which did not function as expected
This commit is contained in:
Hristo Filaretov
2021-08-19 09:05:36 +02:00
committed by GitHub
parent ead4029d49
commit 6db5692be4
2 changed files with 31 additions and 10 deletions

View File

@ -408,7 +408,7 @@ impl ParserScope for Scope {
}
fn remove_alias(&self, name: &str) {
for frame in self.frames.lock().iter_mut().rev() {
if let Some(frame) = self.frames.lock().last_mut() {
frame.aliases.remove(name);
}
}