diff options
author | Araq <rumpf_a@web.de> | 2012-12-06 08:45:18 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2012-12-06 08:45:18 +0100 |
commit | a1f677980270d668b9b22e75a9892e100cc2a6d8 (patch) | |
tree | 6340cc0694ad6acbce83153612af3cb7ad2f82fe /tests/run | |
parent | 1d842e8b75aa95670386b2ac4613932d2e01b9a3 (diff) | |
download | Nim-a1f677980270d668b9b22e75a9892e100cc2a6d8.tar.gz |
implemented AST based overloading
Diffstat (limited to 'tests/run')
-rw-r--r-- | tests/run/tastoverload1.nim | 21 |
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) |