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:
@@ -946,6 +946,7 @@ pub const DeclGen = struct {
|
||||
.extern_func,
|
||||
.func,
|
||||
.enum_literal,
|
||||
.empty_enum_value,
|
||||
=> unreachable, // non-runtime values
|
||||
.int => |int| switch (int.storage) {
|
||||
.u64, .i64, .big_int => try writer.print("{}", .{try dg.fmtIntLiteral(ty, val, location)}),
|
||||
|
||||
@@ -3246,6 +3246,7 @@ pub const DeclGen = struct {
|
||||
},
|
||||
.variable,
|
||||
.enum_literal,
|
||||
.empty_enum_value,
|
||||
=> unreachable, // non-runtime values
|
||||
.extern_func, .func => {
|
||||
const fn_decl_index = switch (val_key) {
|
||||
|
||||
@@ -660,6 +660,7 @@ pub const DeclGen = struct {
|
||||
.extern_func,
|
||||
.func,
|
||||
.enum_literal,
|
||||
.empty_enum_value,
|
||||
=> unreachable, // non-runtime values
|
||||
.int => try self.addInt(ty, val),
|
||||
.err => |err| {
|
||||
|
||||
Reference in New Issue
Block a user