summary refs log tree commit diff stats
path: root/tests/concepts/tcomparable.nim
blob: 06612a47e7d004678e85388e1fd12cdc12fb7140 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
type
  Comparable = concept a
    (a < a) is bool

proc myMax(a, b: Comparable): Comparable =
  if a < b:
    return b
  else:
    return a

doAssert myMax(5, 10) == 10
doAssert myMax(31.3, 1.23124) == 31.3