parent
b3029ba213
commit
6085ad95ff
2 changed files with 21 additions and 2 deletions
|
|
@ -129,7 +129,7 @@
|
||||||
# break :stateLoop
|
# break :stateLoop
|
||||||
|
|
||||||
import
|
import
|
||||||
ast, msgs, idents,
|
ast, astalgo, msgs, idents,
|
||||||
renderer, magicsys, lowerings, lambdalifting, modulegraphs, lineinfos
|
renderer, magicsys, lowerings, lambdalifting, modulegraphs, lineinfos
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
@ -388,6 +388,10 @@ proc hasYieldsInExpressions(n: PNode): bool =
|
||||||
return true
|
return true
|
||||||
else:
|
else:
|
||||||
result = n.hasYields
|
result = n.hasYields
|
||||||
|
of nkCast:
|
||||||
|
for i in 1..<n.len:
|
||||||
|
if n[i].hasYieldsInExpressions:
|
||||||
|
return true
|
||||||
else:
|
else:
|
||||||
for c in n:
|
for c in n:
|
||||||
if c.hasYieldsInExpressions:
|
if c.hasYieldsInExpressions:
|
||||||
|
|
@ -686,7 +690,7 @@ proc lowerStmtListExprs(ctx: var Ctx, n: PNode, needsSplit: var bool): PNode =
|
||||||
of nkCast, nkHiddenStdConv, nkHiddenSubConv, nkConv, nkObjDownConv,
|
of nkCast, nkHiddenStdConv, nkHiddenSubConv, nkConv, nkObjDownConv,
|
||||||
nkDerefExpr, nkHiddenDeref:
|
nkDerefExpr, nkHiddenDeref:
|
||||||
var ns = false
|
var ns = false
|
||||||
for i in 0..<n.len:
|
for i in ord(n.kind == nkCast)..<n.len:
|
||||||
n[i] = ctx.lowerStmtListExprs(n[i], ns)
|
n[i] = ctx.lowerStmtListExprs(n[i], ns)
|
||||||
|
|
||||||
if ns:
|
if ns:
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ Specific except
|
||||||
Multiple idents in except
|
Multiple idents in except
|
||||||
Multiple except branches
|
Multiple except branches
|
||||||
Multiple except branches 2
|
Multiple except branches 2
|
||||||
|
success
|
||||||
'''
|
'''
|
||||||
targets: "c"
|
targets: "c"
|
||||||
"""
|
"""
|
||||||
|
|
@ -101,3 +102,17 @@ assert y.waitFor() == 2
|
||||||
|
|
||||||
y = test4()
|
y = test4()
|
||||||
assert y.waitFor() == 2
|
assert y.waitFor() == 2
|
||||||
|
|
||||||
|
# bug #14279
|
||||||
|
|
||||||
|
proc expandValue: Future[int] {.async.} =
|
||||||
|
return 0
|
||||||
|
|
||||||
|
proc a(b: int): Future[void] {.async.} =
|
||||||
|
return
|
||||||
|
|
||||||
|
proc b: Future[void] {.async.} =
|
||||||
|
await a(await expandValue())
|
||||||
|
echo "success"
|
||||||
|
|
||||||
|
waitFor(b())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue