#What is the layout of @typeInfo?

1 messages · Page 1 of 1 (latest)

agile matrix
#

I have seen the @typeInfo built in in the documentation.
But it doesn't say anything about what info it contains. I believe it's a union with different fields such as .Enum. Where can I find the complete layout of the data that is returned?

I have tried printing the @typeInfo but I'm not sure how to do it.

const Field = enum { byr, ity, eyr, hgt, hcl, ecl, pid, cid };
print("{any}\n", .{@typeInfo(Field)});
lavish valve
#

std.builtin.Type, which is defined in lib/std/builtin.zig

agile matrix
still inlet
#

the return type is shown after the function signature

agile matrix
still inlet
#

wdym?

agile matrix
#

This is what I see in the docs:

still inlet
#

what version are you looking at?

#

oh wait

agile matrix
#

master

still inlet
#

youre looking at TypeOf not typeInfo

agile matrix
#

Ahhh, my bad