summary refs log tree commit diff stats
path: root/tests/lookups/tredef.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lookups/tredef.nim')
-rw-r--r--tests/lookups/tredef.nim29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/lookups/tredef.nim b/tests/lookups/tredef.nim
new file mode 100644
index 000000000..7c1df238e
--- /dev/null
+++ b/tests/lookups/tredef.nim
@@ -0,0 +1,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()