summary refs log tree commit diff stats
path: root/nimsuggest/tests
diff options
context:
space:
mode:
authorJake Leahy <jake@leahy.dev>2022-12-28 17:35:11 +1100
committerGitHub <noreply@github.com>2022-12-28 07:35:11 +0100
commit3d5dbf8f96a5106a3b817a45a926303bc5623786 (patch)
tree37f3436f3e051b523289612d07755a15157d99fc /nimsuggest/tests
parent9efa56a8bbacab2075a4c2fe4c5424d57b6eab46 (diff)
downloadNim-3d5dbf8f96a5106a3b817a45a926303bc5623786.tar.gz
Fix nimsuggest not suggesting fields in when theres static parameters (#21189)
Don't check against empty arguments

Add test case
Diffstat (limited to 'nimsuggest/tests')
-rw-r--r--nimsuggest/tests/t21185.nim18
1 files changed, 18 insertions, 0 deletions
diff --git a/nimsuggest/tests/t21185.nim b/nimsuggest/tests/t21185.nim
new file mode 100644
index 000000000..bf5a0e3cc
--- /dev/null
+++ b/nimsuggest/tests/t21185.nim
@@ -0,0 +1,18 @@
+
+# Reduced case of 21185. Issue was first parameter being static
+proc foo(x: static[int]) = discard
+
+type
+  Person = object
+    name: string
+    age: int
+
+let p = Person()
+p.#[!]#
+
+discard """
+$nimsuggest --tester --v3 --maxresults:2 $file
+>sug $1
+sug;;skField;;age;;int;;$file;;8;;4;;"";;100;;None
+sug;;skField;;name;;string;;$file;;7;;4;;"";;100;;None
+"""