public boolean isCompatible(AstType type)
    {
        if (type.isANumber())
            {
            AstType newType = resultantType(type);
            return !newType.isUndefined();
            }

        if (isSet() && type.isSet())
            {
            if ((getSetType().getType() == TYPE_EMPTY) ||
                    (type.getSetType().getType() == TYPE_EMPTY))
                {
                return true;
                }
            return getSetType().isCompatible(type.getSetType());
            }

        if (isSequence() && type.isSequence())
            {
            return getSetType().isCompatible(type.getSetType());
            }

        if (getType() == type.getType())
            {
            return isEqual(type);
            }
        return false;
    }