fixes yet another gensym regression (#12145)

This commit is contained in:
Andreas Rumpf 2019-09-06 00:45:00 +02:00 • committed by GitHub
commit 488f3ed085
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 34 additions and 10 deletions

View file

@ -7,4 +7,18 @@ template templ*(): int =
bind gx, gy
gx + gy
import json
const
codeField = "foobar"
messageField = "more"
template trap*(path: string, body: untyped): untyped =
#bind codeField, messageField
try:
body
except:
let msg = getCurrentExceptionMsg()
#debug "Error occurred within RPC ", path = path, errorMessage = msg
result = %*{codeField: "SERVER_ERROR", messageField: msg}

View file

@ -7,6 +7,7 @@ a
hi
Hello, World!
(e: 42)
hey
'''
"""
@ -235,3 +236,12 @@ var
x = X.fails(42)
echo x
import mtempl5
proc foo(): auto =
trap "foo":
echo "hey"
discard foo()