aboutsummaryrefslogtreecommitdiff
path: root/exercises/057_unions3.zig
diff options
context:
space:
mode:
Diffstat (limited to 'exercises/057_unions3.zig')
-rw-r--r--exercises/057_unions3.zig4
1 files changed, 3 insertions, 1 deletions
diff --git a/exercises/057_unions3.zig b/exercises/057_unions3.zig
index 142180f..860c979 100644
--- a/exercises/057_unions3.zig
+++ b/exercises/057_unions3.zig
@@ -15,7 +15,7 @@
//
const std = @import("std");
-const Insect = union(InsectStat) {
+const Insect = union(enum) {
flowers_visited: u16,
still_alive: bool,
};
@@ -24,6 +24,8 @@ pub fn main() void {
var ant = Insect{ .still_alive = true };
var bee = Insect{ .flowers_visited = 17 };
+ //ant.flowers_visited = 26; // wow 'terminated unexpectedly' isn't super helpful error
+
std.debug.print("Insect report! ", .{});
printInsect(ant);