updated inference_context rules

This commit is contained in:
pca006132 2021-06-28 16:32:46 +08:00
parent e72d96f165
commit f43e225845
1 changed files with 4 additions and 2 deletions

View File

@ -64,8 +64,10 @@ impl<'a> InferenceContext<'a> {
let (_, level) = self.stack.sym_def.last().unwrap();
if *level > self.stack.level {
let (name, _) = self.stack.sym_def.pop().unwrap();
let (t, _, l) = self.sym_table.remove(name).unwrap();
poped_names.push((name, t, l));
let (t, b, l) = self.sym_table.get_mut(name).unwrap();
// set it to be unreadable
*b = false;
poped_names.push((name, t.clone(), *l));
} else {
break;
}