Skip to content

Commit c517e77

Browse files
authored
fix btreetables key not found error: compiles(...) was using wrong symbol (#92)
1 parent 3685382 commit c517e77

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/fusion/btreetables.nim

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ proc `[]`*[A, B](t: Table[A, B]; x: A): B =
179179
else:
180180
a = if r == 0: a.p0 else: a.e[r-1].p
181181
if a.isNil:
182-
when compiles($key):
183-
raise newException(KeyError, "key not found: " & $key)
182+
when compiles($x):
183+
raise newException(KeyError, "key not found: " & $x)
184184
else:
185185
raise newException(KeyError, "key not found")
186186

@@ -209,8 +209,8 @@ proc `[]`*[A, B](t: var Table[A, B]; x: A): var B =
209209
else:
210210
a = if r == 0: a.p0 else: a.e[r-1].p
211211
if a.isNil:
212-
when compiles($key):
213-
raise newException(KeyError, "key not found: " & $key)
212+
when compiles($x):
213+
raise newException(KeyError, "key not found: " & $x)
214214
else:
215215
raise newException(KeyError, "key not found")
216216

0 commit comments

Comments
 (0)