summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2015-01-10 22:57:22 +0100
committerAraq <rumpf_a@web.de>2015-01-10 23:52:29 +0100
commit8cb31d86b66457e9db848bb3f55f25fe58c4a7da (patch)
treeeae7be4f38811103065f009c4f6a4b59323a547a /tests
parent3273d32acc0ad9452ccbb9790769806af9721571 (diff)
downloadNim-8cb31d86b66457e9db848bb3f55f25fe58c4a7da.tar.gz
fixes tconfusing_arrow bug
Diffstat (limited to 'tests')
-rw-r--r--tests/generics/tconfusing_arrow.nim15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/generics/tconfusing_arrow.nim b/tests/generics/tconfusing_arrow.nim
new file mode 100644
index 000000000..6a5a9d682
--- /dev/null
+++ b/tests/generics/tconfusing_arrow.nim
@@ -0,0 +1,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()