mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-18 17:08:32 +00:00
Added test for #3304
This commit is contained in:
15
tests/closure/tclosureinference3304.nim
Normal file
15
tests/closure/tclosureinference3304.nim
Normal file
@@ -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)))
|
||||
Reference in New Issue
Block a user