summary refs log tree commit diff stats
path: root/tests/closure
diff options
context:
space:
mode:
authorDominik Picheta <dominikpicheta@gmail.com>2016-01-16 13:32:26 +0000
committerDominik Picheta <dominikpicheta@gmail.com>2016-01-16 13:32:26 +0000
commitb6e8a1437bf007aa9914f10a3f1c78b27b2a359d (patch)
tree0eafc45018fb813a329aa2977374121dc2ffbb33 /tests/closure
parent34a783a61c0b59327891b4a026b80b75acbf022f (diff)
downloadNim-b6e8a1437bf007aa9914f10a3f1c78b27b2a359d.tar.gz
Added test for #3304
Diffstat (limited to 'tests/closure')
-rw-r--r--tests/closure/tclosureinference3304.nim15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/closure/tclosureinference3304.nim b/tests/closure/tclosureinference3304.nim
new file mode 100644
index 000000000..db4aa1d04
--- /dev/null
+++ b/tests/closure/tclosureinference3304.nim
@@ -0,0 +1,15 @@
+discard """
+  output: '''@[1, 2, 5]'''
+"""
+
+import future, sequtils
+
+type
+  List[T] = ref object
+    val: T
+  
+proc foo[T](l: List[T]): seq[int] =
+  @[1,2,3,5].filter(x => x != l.val)
+
+when isMainModule:
+  echo(foo(List[int](val: 3)))