Skip to content

Commit b6bbe31

Browse files
authored
Merge pull request #14605 from moiseev/flatmap-versioned-deprecation
[stdlib] Only deprecate flatMap starting with Swift 4.1
2 parents 77c575a + 2670874 commit b6bbe31

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

stdlib/public/core/FlatMap.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ extension LazySequenceProtocol {
6060
///
6161
/// - Complexity: O(1)
6262
@inline(__always)
63-
@available(*, deprecated, renamed: "compactMap(_:)",
63+
@available(swift, deprecated: 4.1, renamed: "compactMap(_:)",
6464
message: "Please use compactMap(_:) for the case where closure returns an optional value")
6565
public func flatMap<ElementOfResult>(
6666
_ transform: @escaping (Elements.Element) -> ElementOfResult?
@@ -124,7 +124,7 @@ extension LazyCollectionProtocol {
124124
/// collection as its argument and returns an optional value.
125125
///
126126
/// - Complexity: O(1)
127-
@available(*, deprecated, renamed: "compactMap(_:)",
127+
@available(swift, deprecated: 4.1, renamed: "compactMap(_:)",
128128
message: "Please use compactMap(_:) for the case where closure returns an optional value")
129129
@_inlineable // FIXME(sil-serialize-all)
130130
public func flatMap<ElementOfResult>(

stdlib/public/core/SequenceAlgorithms.swift.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,7 @@ extension Sequence {
783783
/// - Complexity: O(*m* + *n*), where *m* is the length of this sequence
784784
/// and *n* is the length of the result.
785785
@inline(__always)
786-
@available(*, deprecated, renamed: "compactMap(_:)",
786+
@available(swift, deprecated: 4.1, renamed: "compactMap(_:)",
787787
message: "Please use compactMap(_:) for the case where closure returns an optional value")
788788
public func flatMap<ElementOfResult>(
789789
_ transform: (Element) throws -> ElementOfResult?

stdlib/public/core/StringRangeReplaceableCollection.swift.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ extension Collection {
581581
return try _compactMap(transform)
582582
}
583583

584-
@available(*, deprecated, renamed: "compactMap(_:)",
584+
@available(swift, deprecated: 4.1, renamed: "compactMap(_:)",
585585
message: "Please use compactMap(_:) for the case where closure returns an optional value")
586586
@inline(__always)
587587
public func flatMap(

test/stdlib/FlatMapDeprecation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-typecheck-verify-swift %s
1+
// RUN: %swift -swift-version 4 -typecheck -verify %s
22

33
func flatMapOnSequence<
44
S : Sequence

0 commit comments

Comments
 (0)