summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorcooldome <ariabushenko@gmail.com>2020-09-24 00:07:30 +0100
committerGitHub <noreply@github.com>2020-09-24 00:07:30 +0100
commitf21a49b2c4b20402198546aae9d9884bb9fa2a9f (patch)
treedab4b99dfde8f2964f283c181f09feb5cee815e3 /tests
parentfe3211fbcfa6b14a2e2fcd4dfb8664dcf8a1bd21 (diff)
downloadNim-f21a49b2c4b20402198546aae9d9884bb9fa2a9f.tar.gz
Fix #15389 (#15390)
* allow result symbol reuse

* try different approach

* Revert "try different approach"

This reverts commit abcfb6b75983c2f798cc887342ff1a9ff10c0324.
Diffstat (limited to 'tests')
-rw-r--r--tests/macros/tmacros_issues.nim17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/macros/tmacros_issues.nim b/tests/macros/tmacros_issues.nim
index f53429888..3d992a27f 100644
--- a/tests/macros/tmacros_issues.nim
+++ b/tests/macros/tmacros_issues.nim
@@ -480,3 +480,20 @@ func expMin: float
 func expMin: float {.aadMin.} = 1
 
 echo expMin()
+
+
+# issue #15389
+block double_sem_for_procs:
+
+  macro aad(fns: varargs[typed]): typed =
+    result = newStmtList()
+    for fn in fns:
+      result.add fn
+
+  func exp(x: float): float {.aad.} =
+    var x1 = min(max(x, -708.4), 709.8)
+    if x1 > 0.0:
+      return x1 + 1.0
+    result = 10.0
+
+  discard exp(5.0)
\ No newline at end of file