summary refs log tree commit diff stats
path: root/tests/metatype/utypeclasses.nim
blob: f94b3974258169f4fddfb31d2416bb3aa0eace21 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
import unittest

proc concat(a, b): string =
  result = $a & $b

block: # if proc param types are not supplied, the params are assumed to be generic
  check concat(1, "test") == "1test"
  check concat(1, 20) == "120"
  check concat("foo", "bar") == "foobar"

block: # explicit param types can still be specified
  check concat[cstring, cstring]("x", "y") == "xy"