Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pub a: @typeOf(@This()),
- b : make_type(),
- const Self = @This();
- fn ret_b(comptime self: *const type) type {
- var foo = @ptrCast(*const Self, self);
- return foo.b;
- }
- fn make_type() type {
- const self = @This();
- const std = @import("std");
- const x = std.mem.eql(u8, ret_b(&self).ret_b(), "main");
- std.debug.assert(x);
- return bool;
- }
- test "" {
- const std = @import("std");
- const s = @This(){ .a = std };
- s.x;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement