summary refs log tree commit diff stats
path: root/tests/lookups/tredef.nim
blob: 7c1df238ecd62b6d9b864cb1920b1d7978e7fe0d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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()