mirror of
https://github.com/erg-lang/erg.git
synced 2025-10-02 21:44:34 +00:00
Fix #272
This commit is contained in:
parent
f21715c8c1
commit
4a0143302f
3 changed files with 15 additions and 0 deletions
|
@ -950,6 +950,12 @@ impl Context {
|
|||
self.kind = kind;
|
||||
}
|
||||
|
||||
pub(crate) fn clear_invalid_vars(&mut self) {
|
||||
self.locals.retain(|_, v| v.t != Failure);
|
||||
self.decls.retain(|_, v| v.t != Failure);
|
||||
self.params.retain(|(_, v)| v.t != Failure);
|
||||
}
|
||||
|
||||
pub fn pop(&mut self) -> Context {
|
||||
if let Some(parent) = self.outer.as_mut() {
|
||||
let parent = mem::take(parent);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue