fix: error on non-exhaustive enums with zero width backing type (#21374)
Co-authored-by: WillLillis <wlillis@umass.edu>
This commit is contained in:
17
test/cases/compile_errors/zero_width_nonexhaustive_enum.zig
Normal file
17
test/cases/compile_errors/zero_width_nonexhaustive_enum.zig
Normal 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'
|
||||
Reference in New Issue
Block a user