pointfreeco / swift-case-paths

🧰 Case paths extends the key path hierarchy to enum cases.
https://www.pointfree.co/collections/enums-and-structs/case-paths
MIT License
921 stars 108 forks source link

(#42) handle embed's argument being promoted out of Optional #43

Closed mayoff closed 3 years ago

mayoff commented 3 years ago

Swift can promoted a function taking an Optional argument to a function taking a non-Optional argument. For example, it can promote Result<String?, Error>.success from (String?) -> Result<String?, Error> to (String) -> Result<String?, Error>.

This commit handles that scenario properly.

Fixes #42.