mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-12 14:23:45 +00:00
* 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>
30 lines
552 B
Nim
30 lines
552 B
Nim
template foo(a: int, b: string) = discard
|
|
foo(1, "test")
|
|
|
|
proc bar(a: int, b: string) = discard
|
|
bar(1, "test")
|
|
|
|
template foo(a: int, b: string) {.redefine.} = bar(a, b)
|
|
foo(1, "test")
|
|
|
|
block:
|
|
proc bar(a: int, b: string) = discard
|
|
template foo(a: int, b: string) = discard
|
|
foo(1, "test")
|
|
bar(1, "test")
|
|
|
|
proc baz =
|
|
proc foo(a: int, b: string) = discard
|
|
proc foo(b: string) =
|
|
template bar(a: int, b: string) = discard
|
|
bar(1, "test")
|
|
|
|
foo("test")
|
|
|
|
block:
|
|
proc foo(b: string) = discard
|
|
foo("test")
|
|
foo(1, "test")
|
|
|
|
baz()
|