Skip to content

[stdlib] Removing the deprecated flatMap overload #9397

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions stdlib/public/core/SequenceAlgorithms.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -729,13 +729,6 @@ extension Sequence {
}
return result
}

@available(*, deprecated, message: "This call uses implicit promotion to optional. Please use map instead.")
public func flatMap<T>(
_ transform: (${GElement}) throws -> T
) rethrows -> [T] {
return try map(transform)
}
}

extension Sequence {
Expand Down
3 changes: 1 addition & 2 deletions test/Constraints/closures.swift
Original file line number Diff line number Diff line change
Expand Up @@ -512,8 +512,7 @@ func returnsArray() -> [Int] { return [] }

returnsArray().flatMap { $0 }.flatMap { }
// expected-warning@-1 {{expression of type 'Int' is unused}}
// expected-warning@-2 {{Please use map instead.}}
// expected-warning@-3 {{result of call to 'flatMap' is unused}}
// expected-warning@-2 {{result of call to 'flatMap' is unused}}

// rdar://problem/30271695
_ = ["hi"].flatMap { $0.isEmpty ? nil : $0 }
39 changes: 0 additions & 39 deletions test/stdlib/FlatMapDiagnostics.swift.gyb

This file was deleted.