Commit 0eddee449d

Andrew Kelley <andrew@ziglang.org>
2019-09-11 21:05:00
add behavior test for `@enumToInt(enum(u1){x}.x)`
closes #2737
1 parent 67491a4
Changed files (1)
test
stage1
behavior
test/stage1/behavior/enum.zig
@@ -1007,3 +1007,10 @@ test "enum literal casting to error union with payload enum" {
 
     expect((try bar) == Bar.B);
 }
+
+test "enum with one member and u1 tag type @enumToInt" {
+    const Enum = enum(u1) {
+        Test,
+    };
+    expect(@enumToInt(Enum.Test) == 0);
+}