mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-12 22:33:49 +00:00
added missing test case
This commit is contained in:
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)
|
||||
Reference in New Issue
Block a user