You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import asyncdispatch
type
R*[P] =object
updates*: seq[P]
D*[T, P] =refobject
ps: seq[P]
t: T
procnewD*[T, P](ps: seq[P], t: T): D[T, P] =D[T, P](ps: ps, t: t)
procloop*[T, P](d: D[T, P]) =var results =newSeq[Future[R[P]]](10)
let d =newD[string, int](@[1], "")
d.loop()
and then user leorize provided even simpler version of the same issue:
type R*[T] =objectprocloop*[T]() =discardnewSeq[R[R[T]]]()
loop[int]()
In both cases, trying to compile the code gives the following error:
Error: cannot instantiate Future
got: <T>
but expected: <T>
Expected Output
The code compiles or at least a helpful message is shown.
Version
$ nim -v
Nim Compiler Version 0.20.2 [Linux: amd64]
Compiled at 2019-07-17
Copyright (c) 2006-2019 by Andreas Rumpf
git hash: 88a0edba4b1a3d535b54336fd589746add54e937
active boot switches: -d:release
The text was updated successfully, but these errors were encountered:
simplified use-case:
and then user leorize provided even simpler version of the same issue:
In both cases, trying to compile the code gives the following error:
Expected Output
The code compiles or at least a helpful message is shown.
Version
The text was updated successfully, but these errors were encountered: