const expect = @import("std").testing.expect; const Number = union { int: i32, float: f64 }; fn makeNumber() Number { return .{.float = 12.34}; } test "anonymous union literal syntax" { var i: Number = .{.int = 42}; var f = makeNumber(); expect(i.int == 42); expect(f.float == 12.34); }