Hi Nim Lovers,
Does anybody know the trick how to declare a type at the point of usage (not upfront as usual). In my case a need to declare enum at the point when I am declaring an enum set. Something like:
var a: set[(enum F1, F2, F3)]
In a real world, I am writing a macro that produces enum typedesc containing all fields on-the-fly of provided object typedesc.
var a: set[fields_enum(T)]
Like this?
template y: auto =
type z = enum F1, F2, F3
z
var a: set[y()]