close #5859 by adding a test
This commit is contained in:
parent
6904f323aa
commit
d1b4f1082e
1 changed files with 11 additions and 0 deletions
|
|
@ -70,3 +70,14 @@ block:
|
||||||
yield 4
|
yield 4
|
||||||
for a in myIter2():
|
for a in myIter2():
|
||||||
echo a
|
echo a
|
||||||
|
|
||||||
|
block t5859:
|
||||||
|
proc flatIterator[T](s: openarray[T]): auto {.noSideEffect.}=
|
||||||
|
result = iterator(): auto =
|
||||||
|
when (T is not seq|array):
|
||||||
|
for item in s:
|
||||||
|
yield item
|
||||||
|
else:
|
||||||
|
yield 123456
|
||||||
|
# issue #5859
|
||||||
|
let it = flatIterator(@[@[1,2], @[3,4]])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue