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
typeAsyncProc=proc(): Future[void]
procmakeCallback[T](v: T): AsyncProc=result=proc() {.async.} =awaitsleepAsync(100)
let c =makeCallback(10)
The problem manifests only when the makeCallback proc is generic. At the moment, it's possible to work-around the issue by manually simulating the low-level mechanics of await:
zah
changed the title
The async pragma cannot be used on a nested proc inside a generic function
The async pragma doesn't work properly with a nested proc inside a generic function
Mar 10, 2019
The following example fails to compile with the the error
Example
The problem manifests only when the
makeCallback
proc is generic. At the moment, it's possible to work-around the issue by manually simulating the low-level mechanics ofawait
:Additional Information
The text was updated successfully, but these errors were encountered: