parent
7674df0dff
commit
64c84a7d11
2 changed files with 24 additions and 13 deletions
|
|
@ -1587,8 +1587,9 @@ proc genInOp(p: BProc, e: PNode, d: var TLoc) =
|
||||||
e.sons[2]
|
e.sons[2]
|
||||||
initLocExpr(p, ea, a)
|
initLocExpr(p, ea, a)
|
||||||
initLoc(b, locExpr, e, OnUnknown)
|
initLoc(b, locExpr, e, OnUnknown)
|
||||||
b.r = rope("(")
|
|
||||||
var length = sonsLen(e.sons[1])
|
var length = sonsLen(e.sons[1])
|
||||||
|
if length > 0:
|
||||||
|
b.r = rope("(")
|
||||||
for i in countup(0, length - 1):
|
for i in countup(0, length - 1):
|
||||||
let it = e.sons[1].sons[i]
|
let it = e.sons[1].sons[i]
|
||||||
if it.kind == nkRange:
|
if it.kind == nkRange:
|
||||||
|
|
@ -1601,6 +1602,9 @@ proc genInOp(p: BProc, e: PNode, d: var TLoc) =
|
||||||
addf(b.r, "$1 == $2", [rdCharLoc(a), rdCharLoc(x)])
|
addf(b.r, "$1 == $2", [rdCharLoc(a), rdCharLoc(x)])
|
||||||
if i < length - 1: add(b.r, " || ")
|
if i < length - 1: add(b.r, " || ")
|
||||||
add(b.r, ")")
|
add(b.r, ")")
|
||||||
|
else:
|
||||||
|
# handle the case of an empty set
|
||||||
|
b.r = rope("0")
|
||||||
putIntoDest(p, d, e, b.r)
|
putIntoDest(p, d, e, b.r)
|
||||||
else:
|
else:
|
||||||
assert(e.sons[1].typ != nil)
|
assert(e.sons[1].typ != nil)
|
||||||
|
|
|
||||||
7
tests/iter/t8041.nim
Normal file
7
tests/iter/t8041.nim
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
iterator xy[T](a: T, b: set[T]): T =
|
||||||
|
if a in b:
|
||||||
|
yield a
|
||||||
|
|
||||||
|
for a in xy(1'i8, {}):
|
||||||
|
for b in xy(a, {}):
|
||||||
|
echo a
|
||||||
Loading…
Add table
Add a link
Reference in a new issue