diff options
author | flywind <xzsflywind@gmail.com> | 2022-04-25 17:19:21 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-25 11:19:21 +0200 |
commit | 15ae9323e8f1e045bdd68e16231528f8c08fb611 (patch) | |
tree | 638499b14315cdbf334f4d12fa9c922e133bb361 /tests | |
parent | 465fd06d50d0dd2e65762b718ea9a726d94c110b (diff) | |
download | Nim-15ae9323e8f1e045bdd68e16231528f8c08fb611.tar.gz |
fix NimNode comment repr() regression [backport: 1.2] (#19726)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/macros/tmacros1.nim | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/macros/tmacros1.nim b/tests/macros/tmacros1.nim index 53af4287c..c588ff7e6 100644 --- a/tests/macros/tmacros1.nim +++ b/tests/macros/tmacros1.nim @@ -60,3 +60,22 @@ macro foo(t: static Tuple): untyped = doAssert t.b == 12345 foo((a: "foo", b: 12345)) + + +# bug #16307 + +macro bug(x: untyped): string = + newLit repr(x) + +let res = bug: + block: + ## one + ## two + ## three + +doAssert res == """ + +block: + ## one + ## two + ## three""" |