summary refs log tree commit diff stats
path: root/tests/concepts/tvarconcept.nim
blob: e33686b0545d37da1d1d0d263973a58b37dffe5f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# bug #2346

type RNG64 = concept var rng
  rng.randomUint64() is uint64

proc randomInt*(rng: var RNG64; max: int): int = 4


type MyRNG* = object

proc randomUint64*(self: var MyRNG): uint64 = 4

var r = MyRNG()
echo r.randomInt(5)