{"action":"created","issue":{"url":"https://api.github.com/repos/nim-lang/Nim/issues/4753","repository_url":"https://api.github.com/repos/nim-lang/Nim","labels_url":"https://api.github.com/repos/nim-lang/Nim/issues/4753/labels{/name}","comments_url":"https://api.github.com/repos/nim-lang/Nim/issues/4753/comments","events_url":"https://api.github.com/repos/nim-lang/Nim/issues/4753/events","html_url":"https://github.com/nim-lang/Nim/issues/4753","id":176357612,"number":4753,"title":"Cannot use {.async.} with anonymous proc","user":{"login":"endragor","id":2417849,"avatar_url":"https://avatars2.githubusercontent.com/u/2417849?v=4","gravatar_id":"","url":"https://api.github.com/users/endragor","html_url":"https://github.com/endragor","followers_url":"https://api.github.com/users/endragor/followers","following_url":"https://api.github.com/users/endragor/following{/other_user}","gists_url":"https://api.github.com/users/endragor/gists{/gist_id}","starred_url":"https://api.github.com/users/endragor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/endragor/subscriptions","organizations_url":"https://api.github.com/users/endragor/orgs","repos_url":"https://api.github.com/users/endragor/repos","events_url":"https://api.github.com/users/endragor/events{/privacy}","received_events_url":"https://api.github.com/users/endragor/received_events","type":"User","site_admin":false},"labels":[{"id":352133737,"url":"https://api.github.com/repos/nim-lang/Nim/labels/async","name":"async","color":"d93f0b","default":false},{"id":110663373,"url":"https://api.github.com/repos/nim-lang/Nim/labels/VM","name":"VM","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-09-12T11:57:07Z","updated_at":"2017-08-04T17:42:37Z","closed_at":null,"body":"``` nim\nimport asyncdispatch\n\nproc awaitCb(cb: proc(): Future[void]) {.async.} =\n  await cb()\n\nawaitCb(proc(): Future[void] {.async.} =\n  await sleepAsync(50))\n```\n\nThis sample fails to compile with two errors:\n\n```\nError: value of type 'proc (): Future[system.void]{.gcsafe, locks: <unknown>.}' has to be discarded\nError: value of type 'Future[system.void]' has to be discarded\n```\n"},"comment":{"url":"https://api.github.com/repos/nim-lang/Nim/issues/comments/320310380","html_url":"https://github.com/nim-lang/Nim/issues/4753#issuecomment-320310380","issue_url":"https://api.github.com/repos/nim-lang/Nim/issues/4753","id":320310380,"user":{"login":"enthus1ast","id":13794470,"avatar_url":"https://avatars1.githubusercontent.com/u/13794470?v=4","gravatar_id":"","url":"https://api.github.com/users/enthus1ast","html_url":"https://github.com/enthus1ast","followers_url":"https://api.github.com/users/enthus1ast/followers","following_url":"https://api.github.com/users/enthus1ast/following{/other_user}","gists_url":"https://api.github.com/users/enthus1ast/gists{/gist_id}","starred_url":"https://api.github.com/users/enthus1ast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enthus1ast/subscriptions","organizations_url":"https://api.github.com/users/enthus1ast/orgs","repos_url":"https://api.github.com/users/enthus1ast/repos","events_url":"https://api.github.com/users/enthus1ast/events{/privacy}","received_events_url":"https://api.github.com/users/enthus1ast/received_events","type":"User","site_admin":false},"created_at":"2017-08-04T17:42:37Z","updated_at":"2017-08-04T17:42:37Z","body":"just pulled nim. \r\nis this maybe related somehow?\r\n\r\n```nim\r\nimport asyncdispatch, asynchttpserver\r\n\r\nwhen isMainModule:\r\n  var foo = \"foo\"\r\n  var server = newAsyncHttpServer()\r\n\r\n  proc cb(req: Request): Future[void] {.async.} =\r\n    await req.respond(Http200, foo)\r\n  asyncCheck server.serve(Port(8080), cb )\r\n\r\nrunForever()\r\n```\r\n\r\nfails with\r\n\r\n```nim\r\nbug.nim(10, 20) Error: type mismatch: got (AsyncHttpServer, Port, proc (req: Request): Future[system.void]{.locks: <unknown>.})\r\nbut expected one of: \r\nproc serve(server: AsyncHttpServer; port: Port;\r\n          callback: proc (request: Request): Future[void]; address = \"\"): Future[void]\r\n```\r\n"}}
{"actor":{"display_login":"enthus1ast"}}