added missing test case
This commit is contained in:
parent
e8b4217c3b
commit
ca5c329533
1 changed files with 15 additions and 0 deletions
15
tests/concepts/tvarconcept.nim
Normal file
15
tests/concepts/tvarconcept.nim
Normal file
|
|
@ -0,0 +1,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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue