You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def result is incorrect when used on template without parentheses
let num =10templatesometemplate: auto= num +1echosometemplate()
echo sometemplate
templatevaralias: auto= num
echovaralias()
echo varalias
Nim Version
Nim Compiler Version 2.2.1 [Windows: amd64]
Compiled at 2024-11-28
Copyright (c) 2006-2024 by Andreas Rumpf
active boot switches: -d:release
Current Output
echo sometemplate()
^ --> here (def is working as expected)
> def 4:5
def skTemplate main.sometemplate template (): auto ...\main.nim 3 9 "" 100
echo sometemplate
^ --> here (def is not working as expected)
> def 5:5
def skProc system.`+` proc (x: int, y: int): int{.noSideEffect, raises: <inferred> [].} ...\nim\lib\system\arithmetics.nim 75 5 "Binary `+` operator for an integer." 100
echo varalias()
^ --> here (def is working as expected)
> def 8:5
def skTemplate main.varalias template (): auto ...\main.nim 7 9 "" 100
echo varalias
^ --> here (def is not working as expected)
> def 9:5
def skLet main.num int ...\main.nim 1 4 "" 100
Expected Output
echo sometemplate
^ --> here
> def 5:5
def skTemplate main.sometemplate template (): auto ...\main.nim 3 9 "" 100
echo varalias
^ --> here
> def 9:5
def skTemplate main.varalias template (): auto ...\main.nim 7 9 "" 100
Known Workarounds
No response
Additional Information
It works as expected in --v2 but not in v3, v4.
The text was updated successfully, but these errors were encountered:
Description
def
result is incorrect when used on template without parenthesesNim Version
Nim Compiler Version 2.2.1 [Windows: amd64]
Compiled at 2024-11-28
Copyright (c) 2006-2024 by Andreas Rumpf
active boot switches: -d:release
Current Output
Expected Output
Known Workarounds
No response
Additional Information
It works as expected in
--v2
but not inv3
,v4
.The text was updated successfully, but these errors were encountered: