Commit 4efac777 authored by Alastair Robertson's avatar Alastair Robertson

Semantic analyser: Fix variable assignment checks

parent 50c39995
...@@ -645,7 +645,7 @@ void SemanticAnalyser::visit(AssignVarStatement &assignment) ...@@ -645,7 +645,7 @@ void SemanticAnalyser::visit(AssignVarStatement &assignment)
search->second = assignment.expr->type; search->second = assignment.expr->type;
} }
} }
else if (search->second.type != assignment.expr->type.type || search->second.size != assignment.expr->type.size) { else if (search->second.type != assignment.expr->type.type) {
err_ << "Type mismatch for " << var_ident << ": "; err_ << "Type mismatch for " << var_ident << ": ";
err_ << "trying to assign value of type '" << assignment.expr->type; err_ << "trying to assign value of type '" << assignment.expr->type;
err_ << "'\n\twhen variable already contains a value of type '"; err_ << "'\n\twhen variable already contains a value of type '";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment