From 52cc925e0e34580403b1a405ec8b4fa44c844de5 Mon Sep 17 00:00:00 2001 From: Dominik Picheta Date: Fri, 22 Dec 2017 21:14:27 +0000 Subject: Fixes #6100. --- lib/pure/asyncmacro.nim | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/pure/asyncmacro.nim') diff --git a/lib/pure/asyncmacro.nim b/lib/pure/asyncmacro.nim index a8e378d5c..35523702d 100644 --- a/lib/pure/asyncmacro.nim +++ b/lib/pure/asyncmacro.nim @@ -32,6 +32,12 @@ template createCb(retFutureSym, iteratorNameSym, try: if not nameIterVar.finished: var next = nameIterVar() + # Continue while the yielded future is already finished. + while (not next.isNil) and next.finished: + next = nameIterVar() + if nameIterVar.finished: + break + if next == nil: if not retFutureSym.finished: let msg = "Async procedure ($1) yielded `nil`, are you await'ing a " & -- cgit 1.4.1-2-gfad0 alue='switch'/> This repository contains the Nim compiler, Nim's stdlib, tools, and documentation. (mirror)ahoang <ahoang@tilde.institute>
summary refs log blame commit diff stats
path: root/compiler/ccgthreadvars.nim
blob: 4785402e753a7be4fd65d0e64d22fcd313ff14f5 (plain) (tree)
1
2
3
4
5
6
7
8
9
10