diff options
author | Arne Döring <arne.doering@gmx.net> | 2019-02-19 12:21:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-19 12:21:42 +0100 |
commit | 6b9a139f7f27422bc2d7dc3fad20d589518a93b5 (patch) | |
tree | 1ecb48e244721679870bd858523765800e3e0334 /tests/errmsgs | |
parent | 257965e105c219f2504a2d1d0952fc43efb9598c (diff) | |
download | Nim-6b9a139f7f27422bc2d7dc3fad20d589518a93b5.tar.gz |
error message for accidental use of macro (#10490)
* error message for accidental use of macro
Diffstat (limited to 'tests/errmsgs')
-rw-r--r-- | tests/errmsgs/t10489_a.nim | 9 | ||||
-rw-r--r-- | tests/errmsgs/t10489_b.nim | 9 |
2 files changed, 18 insertions, 0 deletions
diff --git a/tests/errmsgs/t10489_a.nim b/tests/errmsgs/t10489_a.nim new file mode 100644 index 000000000..7cfe0176c --- /dev/null +++ b/tests/errmsgs/t10489_a.nim @@ -0,0 +1,9 @@ +discard """ +errormsg: "cannot assign macro symbol to variable here" +line: 9 +""" + +macro m(body: untyped): untyped = + body + +let x1 = m diff --git a/tests/errmsgs/t10489_b.nim b/tests/errmsgs/t10489_b.nim new file mode 100644 index 000000000..e690f028a --- /dev/null +++ b/tests/errmsgs/t10489_b.nim @@ -0,0 +1,9 @@ +discard """ +errormsg: "cannot assign macro symbol to constant here" +line: 9 +""" + +macro m(body: untyped): untyped = + body + +const x2 = m |