Skip to content
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

[stdlib] Removing the deprecated flatMap overload #9390

Merged
merged 1 commit into from May 8, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 0 additions & 7 deletions stdlib/public/core/SequenceAlgorithms.swift.gyb
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
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.