From f21a49b2c4b20402198546aae9d9884bb9fa2a9f Mon Sep 17 00:00:00 2001 From: cooldome Date: Thu, 24 Sep 2020 00:07:30 +0100 Subject: Fix #15389 (#15390) * allow result symbol reuse * try different approach * Revert "try different approach" This reverts commit abcfb6b75983c2f798cc887342ff1a9ff10c0324. --- tests/macros/tmacros_issues.nim | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests') 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 -- cgit 1.4.1-2-gfad0