diff options
| author | Veikka Tuominen <git@vexu.eu> | 2022-08-28 13:37:38 +0300 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2022-08-28 15:41:21 +0300 |
| commit | 776caaf99927181a2bb135afa9b502014782691c (patch) | |
| tree | a67bbeb7166fe7badbed7790024c98c625808e96 /test/behavior/enum.zig | |
| parent | 6aead18ab332a3cf809b5c824d70cdc52f0e5156 (diff) | |
| download | zig-776caaf99927181a2bb135afa9b502014782691c.tar.gz zig-776caaf99927181a2bb135afa9b502014782691c.zip | |
Sema: fix handling of non-standard int types in empty non-exhaustive enums
Closes #12649
Diffstat (limited to 'test/behavior/enum.zig')
| -rw-r--r-- | test/behavior/enum.zig | 5 |
1 files changed, 5 insertions, 0 deletions
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)); +} |
