summary refs log tree commit diff stats
path: root/tests/run/tastoverload1.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run/tastoverload1.nim')
-rw-r--r--tests/run/tastoverload1.nim21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/run/tastoverload1.nim b/tests/run/tastoverload1.nim
new file mode 100644
index 000000000..c8705547a
--- /dev/null
+++ b/tests/run/tastoverload1.nim
@@ -0,0 +1,21 @@
+discard """
+  output: '''string literal
+no string literal
+no string literal'''
+"""
+
+proc optLit(a: string{lit}) =
+  echo "string literal"
+
+proc optLit(a: string) =
+  echo "no string literal"
+
+const
+  constant = "abc"
+
+var
+  variable = "xyz"
+
+optLit("literal")
+optLit(constant)
+optLit(variable)