public Type resolve(Scope s, int tag) {
        Type ltype = null, rtype = null;
        if (left != null) {
            ltype = resolveExpr(left, s, tag);
        }
        if (right != null) {
            rtype = resolveExpr(right, s, tag);
        }

        // If either non-null operand is a string, assume the result is a string.
        if (ltype == Indexer.idx.builtins.BaseStr || rtype == Indexer.idx.builtins.BaseStr) {
            return Indexer.idx.builtins.BaseStr;
        }
        // If either non-null operand is a number, assume the result is a number.
        if (ltype == Indexer.idx.builtins.BaseNum || rtype == Indexer.idx.builtins.BaseNum) {
            return Indexer.idx.builtins.BaseNum;
        }

        if (ltype == null) {
            return (rtype == null ? Indexer.idx.builtins.unknown : rtype);
        }

        if (rtype == null) {
            return (ltype == null ? Indexer.idx.builtins.unknown : ltype);
        }

        return UnionType.union(ltype, rtype);
    }