zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 0eddee449d8a09a999b352d769b98379865e8dbc (tree)
parent 67491a4222f2dacf047989329d4c16a5a2f163d5
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Wed, 11 Sep 2019 15:05:00 -0400

add behavior test for `@enumToInt(enum(u1){x}.x)`

closes #2737

Diffstat:
Mtest/stage1/behavior/enum.zig | 7+++++++
1 file changed, 7 insertions(+), 0 deletions(-)

diff --git 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); +}