InternPool: add representation for value of empty enums and unions

This is a bit odd, because this value doesn't actually exist:
see #15909. This gets all the empty enum/union behavior tests passing.

Also adds an assertion to `Sema.analyzeBodyInner` which would have
helped figure out the issue here much more quickly.
This commit is contained in:
mlugg
2023-05-31 04:42:18 +01:00
committed by Andrew Kelley
parent 99531b0d52
commit a0d4ef0acf
10 changed files with 66 additions and 13 deletions

View File

@@ -242,6 +242,7 @@ pub fn generateSymbol(
.extern_func,
.func,
.enum_literal,
.empty_enum_value,
=> unreachable, // non-runtime values
.int => {
const abi_size = math.cast(usize, typed_value.ty.abiSize(mod)) orelse return error.Overflow;