-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Description
Couldn't think of a better title, code speaks for itself.
Found in https://github.com/nocturn9x/japl
Example
proc newString(data: int): int =
result = data
template addObject(s: int): untyped =
discard s
s
proc slice() =
let obj = addObject(newString((var intval = 5; intval)))
slice()Current Output
/home/dian/.cache/nim/a_d/@ma.nim.c: In function ‘slice__GUeAIxBAJ79bdeFn6EpeyzA’:
/home/dian/.cache/nim/a_d/@ma.nim.c:94:5: error: redeclaration of ‘intval’ with no linkage
94 | NI intval;
| ^~~~~~
/home/dian/.cache/nim/a_d/@ma.nim.c:92:5: note: previous declaration of ‘intval’ was here
92 | NI intval;
| ^~~~~~Expected Output
Successful compilation?
Possible Solution
$ nim -v
Nim Compiler Version 1.5.1 [Linux: amd64]
Compiled at 2020-10-18
Copyright (c) 2006-2020 by Andreas Rumpf
git hash: 82adefa9d10485478456ff75a700d982471708d2
active boot switches: -d:release -d:danger