From 776caaf99927181a2bb135afa9b502014782691c Mon Sep 17 00:00:00 2001 From: Veikka Tuominen Date: Sun, 28 Aug 2022 13:37:38 +0300 Subject: Sema: fix handling of non-standard int types in empty non-exhaustive enums Closes #12649 --- test/behavior/enum.zig | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/behavior/enum.zig') diff --git a/test/behavior/enum.zig b/test/behavior/enum.zig index 9e96163cc0..517414780b 100644 --- a/test/behavior/enum.zig +++ b/test/behavior/enum.zig @@ -1170,3 +1170,8 @@ test "switch on an extern enum with negative value" { Foo.Bar => return, } } + +test "Non-exhaustive enum with nonstandard int size behaves correctly" { + const E = enum(u15) { _ }; + try expect(@sizeOf(E) == @sizeOf(u15)); +} -- cgit v1.2.3