* fixes #15804 * fix the existing test * add the testcase for #15804 Co-authored-by: narimiran <narimiran@disroot.org>
This commit is contained in:
parent
eb429988cd
commit
dfd8a83f35
3 changed files with 27 additions and 15 deletions
15
tests/async/t15804.nim
Normal file
15
tests/async/t15804.nim
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import asyncdispatch
|
||||
|
||||
type
|
||||
Foo*[E] = ref object
|
||||
op: proc(): Future[bool] {.gcsafe.}
|
||||
|
||||
proc newFoo*[E](): Foo[E] =
|
||||
result = Foo[E]()
|
||||
result.op = proc(): Future[bool] {.gcsafe,async.} =
|
||||
await sleepAsync(100)
|
||||
result = false
|
||||
|
||||
when isMainModule:
|
||||
let f = newFoo[int]()
|
||||
echo waitFor f.op()
|
||||
Loading…
Add table
Add a link
Reference in a new issue