mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 09:54:49 +00:00
* fixes #15804
* fix the existing test
* add the testcase for #15804
Co-authored-by: narimiran <narimiran@disroot.org>
(cherry picked from commit dfd8a83f35)
16 lines
298 B
Nim
16 lines
298 B
Nim
discard """
|
|
errormsg: "'yield' only allowed in an iterator"
|
|
cmd: "nim c $file"
|
|
file: "asyncmacro.nim"
|
|
"""
|
|
import async
|
|
|
|
proc a {.async.} =
|
|
discard
|
|
|
|
await a()
|
|
|
|
# if we overload a fallback handler to get
|
|
# await only available within {.async.}
|
|
# we would need `{.dirty.}` templates for await
|