summary refs log tree commit diff stats
path: root/tests/generics/tconfusing_arrow.nim
blob: 6a5a9d68249fb2e7d447bc92b6eefdc304f6ef11 (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()