From 0eddee449d8a09a999b352d769b98379865e8dbc Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 11 Sep 2019 15:05:00 -0400 Subject: [PATCH] add behavior test for `@enumToInt(enum(u1){x}.x)` closes #2737 --- test/stage1/behavior/enum.zig | 7 +++++++ 1 file changed, 7 insertions(+) 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); +}