This commit is contained in:
Pranav Gaddamadugu 2024-04-16 08:51:10 -07:00
parent 781d7a816a
commit b419dfdce4

View File

@ -69,8 +69,7 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> {
};
// Lookup the variable in the symbol table and retrieve its type.
let var_type = if let Some(var) =
self.symbol_table.borrow().lookup_variable(Location::new(None, var_name.name))
let var_type = if let Some(var) = self.symbol_table.borrow().lookup_variable(Location::new(None, var_name.name))
{
// If the variable exists, then check that it is not a constant.
match &var.declaration {