[[CIR]] Implement 'to-union' cast. (#191485)
This ends up being pretty trivial/can only really happen in 2 ways, the
only useful way is via an extension. This patch implements this.
This doesn't really affect anything as it is a pretty rarely used
feature and thus doesn't appear in the test suite I've seen, but I saw
it while investigating something else.