mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[stdlib] Moving the Array.filter to _ArrayProtocol
Resolves ambiguity in the following expression
_ = Array(0..<10).lazy.flatMap { .some($0) }.filter { _ in false }
Fixes: <rdar://problem/32316948>
This commit is contained in:
@@ -1574,16 +1574,6 @@ extension ${Self} : RangeReplaceableCollection, _ArrayProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
// Since RangeReplaceableCollection now has a version of filter that is less
|
||||
// efficient, we should make the default implementation coming from Sequence
|
||||
// preferred.
|
||||
@_inlineable
|
||||
public func filter(
|
||||
_ isIncluded: (Element) throws -> Bool
|
||||
) rethrows -> [Element] {
|
||||
return try _filter(isIncluded)
|
||||
}
|
||||
|
||||
//===--- algorithms -----------------------------------------------------===//
|
||||
|
||||
@_inlineable
|
||||
|
||||
Reference in New Issue
Block a user