summary refs log tree commit diff stats
path: root/tests/overload/tstaticoverload.nim
blob: 33ca49e566d2867d44465a27e76ec03ccccc8da3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
discard """
output: '''
dynamic: let
dynamic: var
static: const
static: literal
static: constant folding
static: static string
'''
"""

proc foo(s: string) =
  echo "dynamic: ", s

proc foo(s: static[string]) =
  echo "static: ", s

let l = "let"
var v = "var"
const c = "const"

type staticString = static[string]

foo(l)
foo(v)
foo(c)
foo("literal")
foo("constant" & " " & "folding")
foo(staticString("static string"))