From 242d39d27f672a0f3b21f5e8f1752218d1f480f2 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Sun, 19 Apr 2020 14:42:45 +0200 Subject: [PATCH] fixes #12834 (#14017) --- lib/pure/hashes.nim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/pure/hashes.nim b/lib/pure/hashes.nim index 287b152d2..f7b4e907b 100644 --- a/lib/pure/hashes.nim +++ b/lib/pure/hashes.nim @@ -174,16 +174,16 @@ proc hash*[T: proc](x: T): Hash {.inline.} = else: result = hash(pointer(x)) -proc hashIdentity*[T: Ordinal](x: T): Hash {.inline, since: (1, 3).} = +proc hashIdentity*[T: Ordinal|enum](x: T): Hash {.inline, since: (1, 3).} = ## The identity hash. I.e. ``hashIdentity(x) = x``. cast[Hash](ord(x)) when defined(nimIntHash1): - proc hash*[T: Ordinal](x: T): Hash {.inline.} = + proc hash*[T: Ordinal|enum](x: T): Hash {.inline.} = ## Efficient hashing of integers. cast[Hash](ord(x)) else: - proc hash*[T: Ordinal](x: T): Hash {.inline.} = + proc hash*[T: Ordinal|enum](x: T): Hash {.inline.} = ## Efficient hashing of integers. hashWangYi1(uint64(ord(x)))