mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
This one shows the unfortunate consequence that we need Lazy[Forward|Bidirectional|RandomAccess]Collection. There's gonna be a whole lotta gyb'bing going on... Swift SVN r19316
28 lines
398 B
Swift
28 lines
398 B
Swift
// RUN: %target-run-simple-swift | FileCheck %s
|
|
|
|
func test()
|
|
{
|
|
print("[")
|
|
for i in lazy(0..<10).reverse() {
|
|
print(i)
|
|
print(" ")
|
|
}
|
|
print("]\n")
|
|
}
|
|
|
|
func testr()
|
|
{
|
|
print("[")
|
|
for i in lazy(0..<10).reverse().reverse() {
|
|
print(i)
|
|
print(" ")
|
|
}
|
|
print("]\n")
|
|
}
|
|
|
|
test()
|
|
testr()
|
|
|
|
// CHECK: [9 8 7 6 5 4 3 2 1 0 ]
|
|
// CHECK: [0 1 2 3 4 5 6 7 8 9 ]
|