From 9fffffb07b081858db0c2102a0680aa166b48263 Mon Sep 17 00:00:00 2001 From: Jacob G-W Date: Sat, 19 Jun 2021 21:10:22 -0400 Subject: fix code broken from previous commit --- src/value.zig | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/value.zig') diff --git a/src/value.zig b/src/value.zig index 696f3d3d88..008cc3c2fe 100644 --- a/src/value.zig +++ b/src/value.zig @@ -626,6 +626,7 @@ pub const Value = extern union { return std.mem.dupe(allocator, u8, payload.data); } if (self.castTag(.repeated)) |payload| { + _ = payload; @panic("TODO implement toAllocatedBytes for this Value tag"); } if (self.castTag(.decl_ref)) |payload| { @@ -747,6 +748,7 @@ pub const Value = extern union { /// Asserts the type is an enum type. pub fn toEnum(val: Value, enum_ty: Type, comptime E: type) E { + _ = enum_ty; // TODO this needs to resolve other kinds of Value tags rather than // assuming the tag will be .enum_field_index. const field_index = val.castTag(.enum_field_index).?.data; @@ -935,6 +937,7 @@ pub const Value = extern union { /// Converts an integer or a float to a float. /// Returns `error.Overflow` if the value does not fit in the new type. pub fn floatCast(self: Value, allocator: *Allocator, ty: Type, target: Target) !Value { + _ = target; switch (ty.tag()) { .f16 => { @panic("TODO add __trunctfhf2 to compiler-rt"); @@ -1292,17 +1295,21 @@ pub const Value = extern union { pub const ArrayHashContext = struct { pub fn hash(self: @This(), v: Value) u32 { + _ = self; return v.hash_u32(); } pub fn eql(self: @This(), a: Value, b: Value) bool { + _ = self; return a.eql(b); } }; pub const HashContext = struct { pub fn hash(self: @This(), v: Value) u64 { + _ = self; return v.hash(); } pub fn eql(self: @This(), a: Value, b: Value) bool { + _ = self; return a.eql(b); } }; @@ -1345,6 +1352,7 @@ pub const Value = extern union { } pub fn fieldValue(val: Value, allocator: *Allocator, index: usize) error{OutOfMemory}!Value { + _ = allocator; switch (val.tag()) { .@"struct" => { const field_values = val.castTag(.@"struct").?.data; -- cgit v1.2.3