summary refs log tree commit diff stats
path: root/tests/generics/tconfusing_arrow.nim
blob: f63a874e00e87969a8e34c12724af2606f1fbf40 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import algorithm, future

type Deck = object
  value: int

proc sort(h: var seq[Deck]) =
  # works:
  h.sort(proc (x, y: Deck): auto =
    cmp(x.value, y.value))
  # fails:
  h.sort((x, y: Deck) => cmp(ord(x.value), ord(y.value)))

var player: seq[Deck] = @[]

player.sort()