Files
swift-mirror/test/Migrator/fixit_flatMap.swift.expected
Robert Widmann 50159d15b7 [Gardening] Use Vendor=apple Where Possible
This simplifies the usual bundle of OS checks

OS=macosx || OS=ios || OS=tvos || OS=watchos

into

VENDOR=apple

which was added in apple/swift#27307
2020-06-30 23:03:01 -07:00

18 lines
673 B
Plaintext

// RUN: %target-swift-frontend -typecheck %s -swift-version 4
// RUN: %target-swift-frontend -typecheck -update-code -primary-file %s -emit-migrated-file-path %t.result -swift-version 4
// RUN: diff -u %s.expected %t.result
// REQUIRES: VENDOR=apple
func migrate<T, U: Sequence, V: Collection>(lseq: LazySequence<T>, lcol: LazyCollection<T>, seq: U, col: V, test: Bool) {
_ = lseq.compactMap { test ? nil : $0 }
_ = lcol.compactMap { test ? nil : $0 }
_ = seq.compactMap { test ? nil : $0 }
_ = col.compactMap { test ? nil : "\($0)" }
_ = lseq.flatMap { [$0, $0] }
_ = lcol.flatMap { [$0, $0] }
_ = seq.flatMap { [$0, $0] }
_ = col.flatMap { "\($0)" }
}