Skip to content

Instantly share code, notes, and snippets.

@Varriount
Created November 13, 2013 21:46
Show Gist options
  • Save Varriount/7456992 to your computer and use it in GitHub Desktop.
Save Varriount/7456992 to your computer and use it in GitHub Desktop.
# This works
iterator testGenProc[iT, rT](iter:iT): rT {.closure.} =
for i in iter:
yield i
var x = testGenProc[seq[int],int]
echo(x(@[1,2,3]))
echo(x(@[1,2,3]))
# This doesn't
iterator testTypeDescProc(iT:typedesc, rT:typedesc, iter:iT): rT {.closure.} =
for i in iter:
yield i
var x = testTypeDescProc[seq[int],int]
echo(x(@[1,2,3]))
echo(x(@[1,2,3]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment