From 2afce84616e1de176c9e76a3e0146fff7ab1de10 Mon Sep 17 00:00:00 2001 From: Bung Date: Thu, 22 Sep 2022 09:11:39 +0800 Subject: Improve error message when instantiating generics with object constructor (#20358) * Improve error message when instantiating generics with object constructor * follow suggestion * Update compiler/semobjconstr.nim Co-authored-by: Clay Sweetser * Update tests/errmsgs/t19882_2.nim Co-authored-by: Clay Sweetser --- tests/errmsgs/t19882_2.nim | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 tests/errmsgs/t19882_2.nim (limited to 'tests') diff --git a/tests/errmsgs/t19882_2.nim b/tests/errmsgs/t19882_2.nim new file mode 100644 index 000000000..7f3055a5d --- /dev/null +++ b/tests/errmsgs/t19882_2.nim @@ -0,0 +1,5 @@ +discard """ + errormsg: "cannot instantiate: 'A[T]'; the object's generic parameters cannot be inferred and must be explicitly given" +""" +type A[T] = object +var a = A() \ No newline at end of file -- cgit 1.4.1-2-gfad0