fix for template redefinition. test cases added.
This commit is contained in:
parent
d1d5fc8254
commit
6975ba401b
8 changed files with 99 additions and 15 deletions
29
tests/compile/tredef.nim
Normal file
29
tests/compile/tredef.nim
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
template foo(a: int, b: string) = nil
|
||||
foo(1, "test")
|
||||
|
||||
proc bar(a: int, b: string) = nil
|
||||
bar(1, "test")
|
||||
|
||||
template foo(a: int, b: string) = bar(a, b)
|
||||
foo(1, "test")
|
||||
|
||||
block:
|
||||
proc bar(a: int, b: string) = nil
|
||||
template foo(a: int, b: string) = nil
|
||||
foo(1, "test")
|
||||
bar(1, "test")
|
||||
|
||||
proc baz =
|
||||
proc foo(a: int, b: string) = nil
|
||||
proc foo(b: string) =
|
||||
template bar(a: int, b: string) = nil
|
||||
bar(1, "test")
|
||||
|
||||
foo("test")
|
||||
|
||||
block:
|
||||
proc foo(b: string) = nil
|
||||
foo("test")
|
||||
foo(1, "test")
|
||||
|
||||
baz()
|
||||
Loading…
Add table
Add a link
Reference in a new issue