summary refs log tree commit diff stats
path: root/tests/ccgbugs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ccgbugs')
-rw-r--r--tests/ccgbugs/topenarraycast.nim8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/ccgbugs/topenarraycast.nim b/tests/ccgbugs/topenarraycast.nim
new file mode 100644
index 000000000..7d1bc8d03
--- /dev/null
+++ b/tests/ccgbugs/topenarraycast.nim
@@ -0,0 +1,8 @@
+proc foo[T](s: var openArray[T]): T =
+  for x in s: result += x
+
+proc bar(xyz: var seq[int]) =
+  doAssert 6 == (seq[int](xyz)).foo()
+
+var t = @[1,2,3]
+bar(t)