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 <Varriount@users.noreply.github.com>

* Update tests/errmsgs/t19882_2.nim

Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
This commit is contained in:
Bung 2022-09-22 09:11:39 +08:00 • committed by GitHub
commit 2afce84616
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View file

@ -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()