fixes async regression
This commit is contained in:
parent
0844941b35
commit
5be6c95d21
2 changed files with 22 additions and 2 deletions
17
tests/async/tnimcall_to_closure.nim
Normal file
17
tests/async/tnimcall_to_closure.nim
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
|
||||
import asyncdispatch
|
||||
|
||||
proc defaultOnProgressChanged() = discard
|
||||
|
||||
proc ask(x: proc()) = x()
|
||||
|
||||
proc retrFile*(onProgressChanged: proc() {.nimcall.}): Future[void] =
|
||||
var retFuture = newFuture[void]("retrFile")
|
||||
iterator retrFileIter(): FutureBase {.closure.} =
|
||||
ask(onProgressChanged)
|
||||
complete(retFuture)
|
||||
|
||||
var nameIterVar = retrFileIter
|
||||
return retFuture
|
||||
|
||||
discard retrFile(defaultOnProgressChanged)
|
||||
Loading…
Add table
Add a link
Reference in a new issue