On Tuesday, 23 March 2021 at 16:29:52 UTC, Steven Schveighoffer
wrote:
> Consider an assert that validates a SumType is a certain type:
>
> SumType!(string, float, int) someType;
> ...
> someType.match!((T t) {assert(is(T == int)); });
>
> vs.
>
> assert(someType.typeIndex == 2);
How about e.g.:
assert(someType.has!int);
int i = someType.unwrap!int; // asserts has!int