diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-09-11 15:05:00 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-09-11 15:05:00 -0400 |
| commit | 0eddee449d8a09a999b352d769b98379865e8dbc (patch) | |
| tree | de6763742967dbe06124e89992f60c62b09b5a3f /test | |
| parent | 67491a4222f2dacf047989329d4c16a5a2f163d5 (diff) | |
| download | zig-0eddee449d8a09a999b352d769b98379865e8dbc.tar.gz zig-0eddee449d8a09a999b352d769b98379865e8dbc.zip | |
add behavior test for `@enumToInt(enum(u1){x}.x)`
closes #2737
Diffstat (limited to 'test')
| -rw-r--r-- | test/stage1/behavior/enum.zig | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/stage1/behavior/enum.zig b/test/stage1/behavior/enum.zig index 24ea2f9583..3f6b2b7bd3 100644 --- a/test/stage1/behavior/enum.zig +++ b/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); +} |
