import java.util.*;
import org.antlr.runtime.tree.*;

public class TigerAssign extends TigerStatement {
    private TigerReference lhs;
    private TigerExpression rhs;
    
    public static TigerAssign fromAstNode(CommonTree ifTree, TigerScope scope) throws Exception {        
        TigerAssign assignStatement = new TigerAssign();
        
        CommonTree lhsTree = (CommonTree)ifTree.getChild(0);
        TigerReference lhs = TigerReference.forAssignment(lhsTree, scope);
        
        CommonTree rhsTree = (CommonTree)ifTree.getChild(1);
        TigerExpression rhs = TigerExpression.fromAstNode(rhsTree, scope);

        // TODO: verify lhs.type == rhs.type
        
        return assignStatement;
    }
}
@@ -633,23 +633,57 @@
     
-// TODO: verify
+if (!TigerSemanticError.assertTypesMatch(rhsTree,
  lhs
@@ -691,11 +691,9 @@
 type
- ==
+,
  rhs
@@ -697,16 +697,55 @@
 rhs.type
+)) %7B%0A            return null;%0A        %7D
 %0A       

check types on assignment