From d73227920365dcd3f0e58db561bf0934f33e7259 Mon Sep 17 00:00:00 2001 From: Samantha Doran Date: Tue, 1 Mar 2016 11:23:47 -0500 Subject: Don't expect all keys in hashsets to have $ defined --- lib/pure/collections/sets.nim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/pure/collections/sets.nim b/lib/pure/collections/sets.nim index 9a42a21ee..aa4919884 100644 --- a/lib/pure/collections/sets.nim +++ b/lib/pure/collections/sets.nim @@ -163,7 +163,11 @@ proc `[]`*[A](s: var HashSet[A], key: A): var A = var hc: Hash var index = rawGet(s, key, hc) if index >= 0: result = s.data[index].key - else: raise newException(KeyError, "key not found: " & $key) + else: + when compiles($key): + raise newException(KeyError, "key not found: " & $key) + else: + raise newException(KeyError, "key not found") proc mget*[A](s: var HashSet[A], key: A): var A {.deprecated.} = ## returns the element that is actually stored in 's' which has the same -- cgit 1.4.1-2-gfad0