I have a field in an object which I would like to be of the type which is one of a pre-existing enum
type foo = enum int, bool
type bar = object
a: seq or foo
however this results in a type mismatch. How can I extract the data from the enum like i'd like?type Foo = int | bool
assert Foo(42) is Foo
assert Foo(true) is Foo
Variant Type is probably what you are looking for.