type Foo = int | bool
assert Foo(42) is Foo
assert Foo(true) is Foo
RunVariant Type is probably what you are looking for.
type Foo = int | bool
assert Foo(42) is Foo
assert Foo(true) is Foo
RunVariant Type is probably what you are looking for.