-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
AsyncEverything related to Nim's asyncEverything related to Nim's async
Description
Description
The {.async.} pragma cannot be used in conjunction with the proc type. This is unlike other pragmas such as {.gcsafe.} or {.locks.}.
Repro
type Route = tuple[path: Regex, handler: proc(req:Request) {.async.}]
===
"attempting to call undeclared routine: 'async'"
Workaround
Declare proc as having return type Future[T]. Doesn't looks like this then accurately represents the procedure, if it has {.async.} applied.
Metadata
Metadata
Assignees
Labels
AsyncEverything related to Nim's asyncEverything related to Nim's async