~alva/zig-bare

6ece02df06822d7cabed1dbb6de04e5339fe5908 — Alva a month ago 124838d trunk
Add test for duplicate enum values
1 files changed, 12 insertions(+), 0 deletions(-)

M src/test.zig
M src/test.zig => src/test.zig +12 -0
@@ 760,6 760,18 @@ test "invariant: hashmap keys must be of primitive type" {
    );
}

test "invariant: enum values must be unique" {
    try testCompileError(
        \\pub fn main() void {
        \\  const Foo = enum {
        \\    x = 1,
        \\    y = 1,
        \\  };
        \\}
        , "enum tag value 1 already taken"
    );
}

const fs = std.fs;

const boilerplate =