summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2023-11-04 15:50:30 +0800
committerGitHub <noreply@github.com>2023-11-04 08:50:30 +0100
commit95e5ad6927af309552857686bf2c74bfac36cbb7 (patch)
tree1a1265c8f74bcb06d27cbd601592690926e29587 /tests
parentd70a9957e21a60b1756f8ea7c8cdaa9fb89fb2be (diff)
downloadNim-95e5ad6927af309552857686bf2c74bfac36cbb7.tar.gz
fixes #22902; borrow from proc return type mismatch (#22908)
fixes #22902
Diffstat (limited to 'tests')
-rw-r--r--tests/distinct/typeclassborrow.nim8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/distinct/typeclassborrow.nim b/tests/distinct/typeclassborrow.nim
index ee0b07829..5e0c63953 100644
--- a/tests/distinct/typeclassborrow.nim
+++ b/tests/distinct/typeclassborrow.nim
@@ -1,3 +1,5 @@
+import std/tables
+
 type
   Foo = distinct seq[int]
   Bar[N: static[int]] = distinct seq[int]
@@ -46,3 +48,9 @@ proc `==`*(x, y: Fine): bool {.borrow.} =
 var x = Fine("1234")
 var y = Fine("1234")
 doAssert x == y
+
+block: # bug #22902
+  type
+    DistinctTable = distinct Table[int, int]
+
+  proc `[]`(t: DistinctTable; key: int): lent int {.borrow.}