Did someone say that the macro API is supposed to offer everything that the typeinfo module can do?
Two things I haven't been able to figure out are:
Is there anything that hasn't been implemented yet?
In short:
proc hasType(x: NimNode, t: static[string]): bool {. compileTime .} =
sameType(x, bindSym(t))
# then, inside a macro...
if field.hasType("int"): # do something
I am not sure how to get the type size, though. I think you can write your helper that recurse over the type and sums up the size of the components, starting from the sizes of ints and floats