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
This is behaving as designed in Swift 4.2: the original return type is String?, i.e. Optional<String>, and so try? produces Optional<Optional<String>>. In Swift 5 mode this will change to have the flattening behavior you were expecting, per SE-0230.
Note that that change is limited to Swift 5 mode, for source compatibility reasons. That means updating your build settings if you want the new behavior.
Environment
iOS 12.1.2, Swift 4.2
Additional Detail from JIRA
md5: 186af1cebd0fa81ac5b79ad8fd491033
Issue Description:
Optional binding ends up with nil value unexpectedly when the given function marked as throws and wrapped with try?
Sample code block :
The text was updated successfully, but these errors were encountered: