aboutsummaryrefslogtreecommitdiff
path: root/src/value.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-10-04 18:00:21 -0400
committerGitHub <noreply@github.com>2020-10-04 18:00:21 -0400
commit302a69f127ae8542f49d9cd07c7cc49f3bbd6181 (patch)
tree063f062e7701e4679a0e97ad1a25021294663640 /src/value.zig
parent0e2d858d69ee1595bb58d936f83f0e0248d54d68 (diff)
parent6d3858dc8a5e5d510a6c9cc972357dda551628b3 (diff)
downloadzig-302a69f127ae8542f49d9cd07c7cc49f3bbd6181.tar.gz
zig-302a69f127ae8542f49d9cd07c7cc49f3bbd6181.zip
Merge pull request #6295 from Vexu/stage2
Stage2: basic imports
Diffstat (limited to 'src/value.zig')
-rw-r--r--src/value.zig15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/value.zig b/src/value.zig
index b65aa06bea..6e38b1bed4 100644
--- a/src/value.zig
+++ b/src/value.zig
@@ -68,6 +68,7 @@ pub const Value = extern union {
one,
void_value,
unreachable_value,
+ empty_struct_value,
empty_array,
null_value,
bool_true,
@@ -182,6 +183,7 @@ pub const Value = extern union {
.null_value,
.bool_true,
.bool_false,
+ .empty_struct_value,
=> unreachable,
.ty => {
@@ -312,6 +314,8 @@ pub const Value = extern union {
.enum_literal_type => return out_stream.writeAll("@Type(.EnumLiteral)"),
.anyframe_type => return out_stream.writeAll("anyframe"),
+ // TODO this should print `NAME{}`
+ .empty_struct_value => return out_stream.writeAll("struct {}{}"),
.null_value => return out_stream.writeAll("null"),
.undef => return out_stream.writeAll("undefined"),
.zero => return out_stream.writeAll("0"),
@@ -475,6 +479,7 @@ pub const Value = extern union {
.float_128,
.enum_literal,
.@"error",
+ .empty_struct_value,
=> unreachable,
};
}
@@ -543,6 +548,7 @@ pub const Value = extern union {
.enum_literal,
.error_set,
.@"error",
+ .empty_struct_value,
=> unreachable,
.undef => unreachable,
@@ -626,6 +632,7 @@ pub const Value = extern union {
.enum_literal,
.error_set,
.@"error",
+ .empty_struct_value,
=> unreachable,
.undef => unreachable,
@@ -709,6 +716,7 @@ pub const Value = extern union {
.enum_literal,
.error_set,
.@"error",
+ .empty_struct_value,
=> unreachable,
.undef => unreachable,
@@ -820,6 +828,7 @@ pub const Value = extern union {
.enum_literal,
.error_set,
.@"error",
+ .empty_struct_value,
=> unreachable,
.zero,
@@ -907,6 +916,7 @@ pub const Value = extern union {
.enum_literal,
.error_set,
.@"error",
+ .empty_struct_value,
=> unreachable,
.zero,
@@ -1078,6 +1088,7 @@ pub const Value = extern union {
.enum_literal,
.error_set,
.@"error",
+ .empty_struct_value,
=> unreachable,
.zero,
@@ -1152,6 +1163,7 @@ pub const Value = extern union {
.enum_literal,
.error_set,
.@"error",
+ .empty_struct_value,
=> unreachable,
.zero,
@@ -1300,6 +1312,7 @@ pub const Value = extern union {
.enum_literal,
.error_set,
.@"error",
+ .empty_struct_value,
=> unreachable,
.ref_val => self.cast(Payload.RefVal).?.val,
@@ -1383,6 +1396,7 @@ pub const Value = extern union {
.enum_literal,
.error_set,
.@"error",
+ .empty_struct_value,
=> unreachable,
.empty_array => unreachable, // out of bounds array index
@@ -1483,6 +1497,7 @@ pub const Value = extern union {
.enum_literal,
.error_set,
.@"error",
+ .empty_struct_value,
=> false,
.undef => unreachable,