Added HashInt to function calls AutoHash\nFixes issue 2669

This commit is contained in:
Timon Kruiper 2019-06-13 15:44:50 +02:00 committed by Andrew Kelley
parent 4d3356435f
commit 72029c2fc8

View File

@ -564,12 +564,12 @@ pub fn autoHash(key: var, comptime rng: *std.rand.Random, comptime HashInt: type
}, },
builtin.TypeId.Float => |info| { builtin.TypeId.Float => |info| {
return autoHash(@bitCast(@IntType(false, info.bits), key), rng); return autoHash(@bitCast(@IntType(false, info.bits), key), rng, HashInt);
}, },
builtin.TypeId.Bool => return autoHash(@boolToInt(key), rng), builtin.TypeId.Bool => return autoHash(@boolToInt(key), rng, HashInt),
builtin.TypeId.Enum => return autoHash(@enumToInt(key), rng), builtin.TypeId.Enum => return autoHash(@enumToInt(key), rng, HashInt),
builtin.TypeId.ErrorSet => return autoHash(@errorToInt(key), rng), builtin.TypeId.ErrorSet => return autoHash(@errorToInt(key), rng, HashInt),
builtin.TypeId.Promise, builtin.TypeId.Fn => return autoHash(@ptrToInt(key), rng), builtin.TypeId.Promise, builtin.TypeId.Fn => return autoHash(@ptrToInt(key), rng, HashInt),
builtin.TypeId.BoundFn, builtin.TypeId.BoundFn,
builtin.TypeId.ComptimeFloat, builtin.TypeId.ComptimeFloat,