Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const std = @import("std");
- const Union = union(enum) {
- First: void,
- Second: void,
- };
- // Outputs:
- // Union{ .First = void }
- // Union{ .First = void }
- // When I'm expecting:
- // Union{ .First = void }
- // Union{ .Second = void }
- pub fn main() void {
- var x = Union{ .First = {} };
- std.debug.warn("{}\n", x);
- x = Union { .Second = {} };
- std.debug.warn("{}\n", x);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement