Files
swift-mirror/test/Migrator/fixit_flatMap.swift
Artem Chikin 1f14158a1d Introduce VisionOS Platform
This change introduces a new compilation target platform to the Swift compiler - visionOS.

- Changes to the compiler build infrastrucuture to support building compiler-adjacent artifacts and test suites for the new target.
- Addition of the new platform kind definition.
- Support for the new platform in language constructs such as compile-time availability annotations or runtime OS version queries.
- Utilities to read out Darwin platform SDK info containing platform mapping data.
- Utilities to support re-mapping availability annotations from iOS to visionOS (e.g. 'updateIntroducedPlatformForFallback', 'updateDeprecatedPlatformForFallback', 'updateObsoletedPlatformForFallback').
- Additional tests exercising platform-specific availability handling and availability re-mapping fallback code-path.
- Changes to existing test suite to accomodate the new platform.
2024-04-10 09:38:02 -07:00

19 lines
723 B
Swift

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