fix: error on non-exhaustive enums with zero width backing type (#21374)

Co-authored-by: WillLillis <wlillis@umass.edu>
This commit is contained in:
Will Lillis
2025-02-01 22:36:16 -05:00
committed by GitHub
parent 963651bbf2
commit 953355ebea
2 changed files with 22 additions and 6 deletions

View File

@@ -0,0 +1,17 @@
comptime {
_ = enum(i0) { a, _ };
}
comptime {
_ = enum(u0) { a, _ };
}
comptime {
_ = enum(u0) { a, b, _ };
}
// error
//
// :2:9: error: non-exhaustive enum specifies every value
// :6:9: error: non-exhaustive enum specifies every value
// :10:23: error: enumeration value '1' too large for type 'u0'