fix for template redefinition. test cases added.

This commit is contained in:
Zahary Karadjov 2012-03-15 14:15:37 +02:00
commit 6975ba401b
8 changed files with 99 additions and 15 deletions

View file

@ -1,6 +1,6 @@
discard """
file: "toverl2.nim"
output: "true012"
output: "true012innertrue"
"""
# Test new overloading resolution rules
@ -14,14 +14,20 @@ iterator toverl2(x: int): int =
while res < x:
yield res
inc(res)
var
pp: proc (x: bool): string = toverl2
stdout.write(pp(true))
for x in toverl2(3):
stdout.write(toverl2(x))
block:
proc toverl2(x: int): string = return "inner"
stdout.write(toverl2(5))
stdout.write(true)
stdout.write("\n")
#OUT true012
#OUT true012innertrue