From f43e225845bc09ad203b13ccdd7cb40d26141164 Mon Sep 17 00:00:00 2001 From: pca006132 Date: Mon, 28 Jun 2021 16:32:46 +0800 Subject: [PATCH] updated inference_context rules --- nac3core/src/typecheck/context/inference_context.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nac3core/src/typecheck/context/inference_context.rs b/nac3core/src/typecheck/context/inference_context.rs index 44c67b68a..235f63707 100644 --- a/nac3core/src/typecheck/context/inference_context.rs +++ b/nac3core/src/typecheck/context/inference_context.rs @@ -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; }