BUG: IntervalIndex set op bugs for empty results
State: closed

- [X] closes #19101
- [X] tests added / passed
- [X] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [X] whatsnew entry

Fixed bugs described in the issue:
- Set ops that result in an empty index no longer raises.
- For empty results, the return dtype now matches the dtype of the first index.
  - Previously would always return `float64`  or `object` for empty results, depending on the op.
-  Didn't mention the raising issue in the whatsnew, since that behavior never occurred on a release, but did mention the dtype change since it occurs on 0.22.0.

Added an additional  #19016 follow-up:
 - Raise when set operation would result in a prohibited dtype:
   - Occurs when the common subtype between the two indexes is `object`.
   - Ex: `union` between `interval[int64]` and `interval[datetime64[ns]]`.
 - Behavior is generally still the same as after #19016, but improved _how_ the behavior comes about:
    - Previously the error was raised _after_ the set op data was computed, now the check occurs before.
    - Previous error message was generic, now the error message is more specific.
  
  

Labels:
name: Bug
name: Interval
description: Interval data type

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/19112?src=pr&el=h1) Report
> Merging [#19112](https://codecov.io/gh/pandas-dev/pandas/pull/19112?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/8acdf801c501a0ce2ac14ddd676cd248f0f32180?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/19112/graphs/tree.svg?width=650&height=150&src=pr&token=eZ4WkYLtcO)](https://codecov.io/gh/pandas-dev/pandas/pull/19112?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #19112      +/-   ##
==========================================
+ Coverage   91.52%   91.52%   +<.01%     
==========================================
  Files         147      147              
  Lines       48775    48783       +8     
==========================================
+ Hits        44639    44647       +8     
  Misses       4136     4136
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.89% <100%> (ø)` | :arrow_up: |
| #single | `41.61% <10%> (-0.01%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/19112?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/indexes/interval.py](https://codecov.io/gh/pandas-dev/pandas/pull/19112/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9pbnRlcnZhbC5weQ==) | `92.29% <100%> (+0.1%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/19112?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/19112?src=pr&el=footer). Last update [8acdf80...49e0a49](https://codecov.io/gh/pandas-dev/pandas/pull/19112?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

> Didn't mention the raising issue in the whatsnew, since that behavior never occurred on a release, but did mention the dtype change since it occurs on 0.22.0.

generally just add this issue number on the previous whatnew entry
thanks!