mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
* continue #9582 for consts, close #9331, fix #20114 also move extractPragma to ast to pave the way for things like {.strdefine: "abc".} etc * changelog correctly * fix jsgen * update tgetimpl * fix sighashes * fix #19766, add comment about postfix * fix noRewrite LOL refs #16620 * fix changelog * fix destructors
21 lines
336 B
Nim
21 lines
336 B
Nim
block:
|
|
proc get(x: int): int = x
|
|
|
|
template t{get(a)}(a: int): int =
|
|
{.noRewrite.}:
|
|
get(a) + 1
|
|
|
|
doAssert get(0) == 1
|
|
|
|
block:
|
|
var x: int
|
|
|
|
template asgn{a = b}(a: int{lvalue}, b: int) =
|
|
let newVal = b + 1
|
|
# ^ this is needed but should it be?
|
|
{.noRewrite.}:
|
|
a = newVal
|
|
|
|
x = 10
|
|
doAssert x == 11, $x
|