I have the following code
import threadpool
type
Person = object
name: string
age: int
proc worker(): Person =
return Person(name: "john", age: 42)
proc main() =
for i in 0 .. 10:
var t = spawn worker()
echo type(t)
sync()
main()
Run
And I have compiled with
nim c -r --threads:on test.nim
Run
But I get Error: cannot create a flowVar of type: Person. I've tried using
object and tuple but I still get the same error. Is there a way to do this or
am I doing something wrong?
