summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorMiran <narimiran@disroot.org>2021-03-15 18:45:10 +0100
committerGitHub <noreply@github.com>2021-03-15 10:45:10 -0700
commit40a5d6537a68b2fbbc58b995e4a3ef20baface11 (patch)
treefd2fc73d0ae930a2401280b48f3743cc37d7eb39 /tests
parent51a04a3674d62707506774b11a4376a914735aeb (diff)
downloadNim-40a5d6537a68b2fbbc58b995e4a3ef20baface11.tar.gz
fix #17385, `len` must be declared before `items` (#17386)
Diffstat (limited to 'tests')
-rw-r--r--tests/sets/m17385.nim11
-rw-r--r--tests/sets/t17385.nim4
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/sets/m17385.nim b/tests/sets/m17385.nim
new file mode 100644
index 000000000..3919e067a
--- /dev/null
+++ b/tests/sets/m17385.nim
@@ -0,0 +1,11 @@
+import std/sets
+
+type
+  Diff*[T] = object
+    data: T
+
+proc test*[T](diff: Diff[T]) =
+  var bPopular = initHashSet[T]()
+  for element in bPopular.items():
+    echo element
+
diff --git a/tests/sets/t17385.nim b/tests/sets/t17385.nim
new file mode 100644
index 000000000..cc08b4882
--- /dev/null
+++ b/tests/sets/t17385.nim
@@ -0,0 +1,4 @@
+import m17385
+
+let a = Diff[int]()
+a.test()