summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorZahary Karadjov <zahary@gmail.com>2017-06-10 18:33:24 +0300
committerAndreas Rumpf <rumpf_a@web.de>2017-06-20 11:29:42 +0200
commit9c6fe59b55db7abeafda9399ea20401eb1cd48e4 (patch)
treef2e476460cef8b4ffd9ee3ea1d242d4b8a673237 /tests
parent491162d3c8d7ac99ba02fdc2b511a31057ec7a55 (diff)
downloadNim-9c6fe59b55db7abeafda9399ea20401eb1cd48e4.tar.gz
fix #5017; fix #5893
Diffstat (limited to 'tests')
-rw-r--r--tests/overload/tstaticoverload.nim26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/overload/tstaticoverload.nim b/tests/overload/tstaticoverload.nim
new file mode 100644
index 000000000..b919fc0b1
--- /dev/null
+++ b/tests/overload/tstaticoverload.nim
@@ -0,0 +1,26 @@
+discard """
+output: '''
+dynamic: let
+dynamic: var
+static: const
+static: literal
+static: constant folding
+'''
+"""
+
+proc foo(s: string) =
+  echo "dynamic: ", s
+
+proc foo(s: static[string]) =
+  echo "static: ", s
+
+let l = "let"
+let v = "var"
+const c = "const"
+
+foo(l)
+foo(v)
+foo(c)
+foo("literal")
+foo("constant" & " " & "folding")
+