Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // main.zig:
- const std = @import("std");
- const builtin = @import("builtin");
- const typeinfo = builtin.TypeInfo;
- const typeid = builtin.TypeId;
- pub fn main() anyerror!void {
- const info = @typeInfo(@import("namespace.zig"));
- switch (info) {
- typeid.Struct => |s| {
- inline for(s.defs) |def| {
- std.debug.warn("{}\n", def.name);
- }
- },
- else => unreachable,
- }
- }
- // namespace.zig
- const hello = struct {};
- var world: i32 = undefined
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement