[stdlib] Adding a deprecated version of flatMap to warn misuses.#7823
[stdlib] Adding a deprecated version of flatMap to warn misuses.#7823moiseev merged 1 commit intoswiftlang:masterfrom
Conversation
|
@swift-ci Please test |
|
Build failed |
|
Build failed |
|
Should this really be an error or just a warning? edit: sorry I see it is just a warning. The test is failing with an error tho. |
|
@airspeedswift Yeah, |
Due to implicit promotion to optional it is possible to call flatMap with a closure, that does not return an optional. This way the code works, but is unnecessary inefficient. Such uses of flatMap can and should be replaced with map.
|
@swift-ci Please test |
|
Build failed |
|
Build failed |
Due to implicit promotion to optional it is possible to call flatMap
with a closure, that does not return an optional. This way the code
works, but is unnecessary inefficient. Such uses of flatMap can and
should be replaced with map.