new .redefine pragma for templates, warn on redefinition without it (#20211)
* test CI for template redefinitions * adapt asyncmacro * fix quote * fix again * try something else * revert * fix ioselectors_select, disable packages CI * adapt more tests & simplify * more * more * more * rename to redefine, warn on implicit redefinition * basic documentation [skip ci] * Update compiler/lineinfos.nim Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
This commit is contained in:
parent
14656154ef
commit
d1d141b135
19 changed files with 85 additions and 25 deletions
|
|
@ -274,10 +274,10 @@ parse9:
|
|||
block gensym1:
|
||||
template x: untyped = -1
|
||||
template t1() =
|
||||
template x: untyped {.gensym.} = 1
|
||||
template x: untyped {.gensym, redefine.} = 1
|
||||
echo x() # 1
|
||||
template t2() =
|
||||
template x: untyped = 1 # defaults to {.inject.}
|
||||
template x: untyped {.redefine.} = 1 # defaults to {.inject.}
|
||||
echo x() # -1 injected x not available during template definition
|
||||
t1()
|
||||
t2()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue