Disable the assert:
// At least one payload is non-empty (otherwise this // would get laid out as a non-payload enum) assert(getNumNonEmptyPayloadCases() > 0);
in TaggedMultiPayloadEnumTypeInfo because it fails when you have
generic but zero-sized payload enum cases.
Also remove unnecessary "REQUIRES: objc_interop" lines from the enum
reflection tests.
This exercises a number of cases that the previous logic got
wrong, including cases where MPEs are laid out like SPEs,
and cases where we use the SPE or MPE layout strategies for enums
that have no non-empty payloads. (These cases are superficially
similar but differ in how they handle XIs.)
These new tests allowed me to correct a number logical flaws
about how layouts are selected. In particular, cases with
generic payloads are always considered to be non-empty for
purposes of selecting a layout strategy. Only cases that
are statically known to be empty are considered empty for
layout purposes.
Apparently, RemoteMirror chokes on certain MPEs with generic payload types.
It does not recognize the generic payload type so ends up defaulting to a
zero size. This causes the overall enum size to be miscalculated unless there
is another non-generic payload that's at least as large.
The case below requires us to reprocess the metatype to "thicken" it.
That process inadvertently lost information about the depth of generic
nesting, which caused the RemoteMirror to be unable to resolve the type of
`C.E.t` at runtime.
```
class C<T> {
enum E<T> {
case t(T)
case u(Int)
}
var e: E<T>?
}
```
Solution: add code to the thickening logic to recursively thicken
parent types to preserve the nesting of generics.
Resolves rdar://90490128