mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 22:10:33 +00:00
close #5859 by adding a test
This commit is contained in:
@@ -70,3 +70,14 @@ block:
|
||||
yield 4
|
||||
for a in myIter2():
|
||||
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]])
|
||||
|
||||
Reference in New Issue
Block a user