Nim/tests/errmsgs/t12844.nim
Neelesh Chandola 7ebb2baa6c Assigning template to var/let/const gives a proper error (#12851)
* Assigning template to var/let/const gives a proper error

* Fix style
2019-12-09 08:19:40 +00:00

13 lines
433 B
Nim

discard """
cmd: "nim check $file"
errormsg: "cannot assign template 'z' to 'y'. Did you mean to call the template with '()'?"
nimout: '''
t12844.nim(11, 11) Error: cannot assign template 'z' to 'x'. Did you mean to call the template with '()'?
t12844.nim(12, 9) Error: cannot assign template 'z' to 'y'. Did you mean to call the template with '()'?'''
"""
template z*(args: varargs[string, `$`]) =
discard
const x = z
var y = z