public Object visit(Template node) {
            enterScope();

            if (node.getDirectives() != null) {
                for (Directive directive : node.getDirectives()) {
                    check(directive);
                }
            }

            Variable[] declared = node.getParams();
            if (declared != null) {
                for (int i=0; i<declared.length; i++) {
                    check(declared[i]);
                }
            }

            Statement stmt = node.getStatement();
            if (stmt != null) {
                check(stmt);
            }

            Type returnType = mReturnType;
            if (returnType == null) {
                returnType = Type.VOID_TYPE;
            }
            node.setReturnType(returnType);

            exitScope();
            return null;
        }