Fix a scope escaping bug

This commit is contained in:
Shunsuke Shibayama 2022-12-21 14:32:46 +09:00
parent fee464945b
commit 06e0b9c1ae
3 changed files with 18 additions and 15 deletions

View file

@ -1036,7 +1036,10 @@ impl Context {
}
pub(crate) fn check_decls_and_pop(&mut self) -> Result<Context, TyCheckErrors> {
self.check_decls()?;
self.check_decls().map_err(|errs| {
self.pop();
errs
})?;
Ok(self.pop())
}