ORC: cursor inference bugfix (#17973)

* fixed a .cursor inference bug

* added a test case
This commit is contained in:
Andreas Rumpf 2021-05-08 16:47:06 +02:00 • committed by GitHub
commit c14427dbf3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 50 additions and 5 deletions

View file

@ -362,9 +362,9 @@ proc read*[T](future: Future[T] | FutureVar[T]): T =
##
## If the result of the future is an error then that error will be raised.
when future is Future[T]:
let fut = future
let fut {.cursor.} = future
else:
let fut = Future[T](future)
let fut {.cursor.} = Future[T](future)
if fut.finished:
if fut.error != nil:
injectStacktrace(fut)