summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2015-03-23 14:38:22 +0100
committerAraq <rumpf_a@web.de>2015-03-23 14:38:22 +0100
commitca5c3295338260af6cc3f861e19685cb4cd1228a (patch)
treef9e76038d151c30b3561c904f9f995213e697b71
parente8b4217c3bd798457ae6629fcc48b5b73c172d17 (diff)
downloadNim-ca5c3295338260af6cc3f861e19685cb4cd1228a.tar.gz
added missing test case
-rw-r--r--tests/concepts/tvarconcept.nim15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/concepts/tvarconcept.nim b/tests/concepts/tvarconcept.nim
new file mode 100644
index 000000000..e33686b05
--- /dev/null
+++ b/tests/concepts/tvarconcept.nim
@@ -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)