error message for accidental use of macro (#10490)
* error message for accidental use of macro
This commit is contained in:
parent
257965e105
commit
6b9a139f7f
3 changed files with 27 additions and 2 deletions
9
tests/errmsgs/t10489_a.nim
Normal file
9
tests/errmsgs/t10489_a.nim
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
discard """
|
||||
errormsg: "cannot assign macro symbol to variable here"
|
||||
line: 9
|
||||
"""
|
||||
|
||||
macro m(body: untyped): untyped =
|
||||
body
|
||||
|
||||
let x1 = m
|
||||
9
tests/errmsgs/t10489_b.nim
Normal file
9
tests/errmsgs/t10489_b.nim
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
discard """
|
||||
errormsg: "cannot assign macro symbol to constant here"
|
||||
line: 9
|
||||
"""
|
||||
|
||||
macro m(body: untyped): untyped =
|
||||
body
|
||||
|
||||
const x2 = m
|
||||
Loading…
Add table
Add a link
Reference in a new issue