Since the type of API.Default
is the discriminated union type Default1U
, the only(*) way to work with the value inside API.Default is by pattern matching. So you'll need something like:
match foo with
ID e -> ...
| NoId e -> ...
There is no other way(*).
(*) Ignoring reflection