You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[stdlib] Remove the unnecessary compactMap overload
This particular overload of compactMap was mechanically copied from the
`flatMap` while implementing SE-0187, but as community members correctly
noticed on the forum thread
[here](https://forums.swift.org/t/why-is-there-a-collection-flatmap-that-takes-a-closure-returning-string/10141),
there is no code that we should be backward compatible with, since
`compactMap` has only been introduced recently.
After applying this change, the following code is correctly ambiguous
again:
```swift
[].compactMap { _ in nil } // error: 'nil' requires a contextual type
```
as opposed to:
```swift
[].flatMap { _ in nil } // r0 : [String] = []
```
Fixes: https://bugs.swift.org/browse/SR-7052
0 commit comments