public void Visit(IdentifierNode node)
 {
     if (!scope.IsDefined(node.Text, out node.StaticType))
     {
         errors.Add(SemanticError.NotDeclaredVariable(node));
     }
 }
        public void Visit(AssignmentNode node)
        {
            node.ExpressionRight.Accept(this);

            if (!scope.IsDefined(node.ID.Text, out TypeInfo type))
            {
                errors.Add(SemanticError.NotDeclaredVariable(node.ID));
            }

            if (!(node.ExpressionRight.StaticType <= type))
            {
                errors.Add(SemanticError.CannotConvert(node, node.ExpressionRight.StaticType, type));
            }

            node.StaticType = node.ExpressionRight.StaticType;
        }