summary refs log tree commit diff stats
path: root/tests/errmsgs
diff options
context:
space:
mode:
authorBung <crc32@qq.com>2022-09-20 06:31:40 +0800
committerGitHub <noreply@github.com>2022-09-19 18:31:40 -0400
commita302b26e0eaa7a2074d3caac72f7c8a7e79993c5 (patch)
tree5e706d564166045885aebc7c9806b7f567d84be9 /tests/errmsgs
parentc4ba4f06f819d6356fff8ee8ee1df0392091de9a (diff)
downloadNim-a302b26e0eaa7a2074d3caac72f7c8a7e79993c5.tar.gz
fix #19882 Improve error message when instantiating generics that lac… (#20356)
* fix #19882 Improve error message when instantiating generics that lack a type

* Update tests/errmsgs/t19882.nim

Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
Diffstat (limited to 'tests/errmsgs')
-rw-r--r--tests/errmsgs/t19882.nim10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/errmsgs/t19882.nim b/tests/errmsgs/t19882.nim
new file mode 100644
index 000000000..1f2f95ab7
--- /dev/null
+++ b/tests/errmsgs/t19882.nim
@@ -0,0 +1,10 @@
+
+discard """
+  errormsg: "cannot instantiate 'A[T, P]' inside of type definition: 'init'; Maybe generic arguments are missing?"
+"""
+type A[T,P] = object
+  b:T
+  c:P
+proc init(): ref A =      
+  new(result)
+var a = init()