t24112.nim 593 B

1234567891011121314151617181920
  1. discard """
  2. matrix: "--skipParentCfg --filenames:legacyRelProj --hints:off"
  3. action: reject
  4. """
  5. # issue #24112, needs --experimental:openSym disabled
  6. block: # simplified
  7. type
  8. SomeObj = ref object # Doesn't error if you make SomeObj be non-ref
  9. template foo = yield SomeObj()
  10. when compiles(foo): discard
  11. import std/asyncdispatch
  12. block:
  13. proc someProc(): Future[void] {.async.} = discard
  14. proc foo() =
  15. await someProc() #[tt.Error
  16. ^ Can only 'await' inside a proc marked as 'async'. Use 'waitFor' when calling an 'async' proc in a non-async scope instead]#