[SR-2942] Errant ambiguous overloaded method when return type optionality differs #45536
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
type checker
Area → compiler: Semantic analysis
Attachment: Download
Environment
Xcode 8, macOS 10.11.6
Additional Detail from JIRA
md5: e004ab1ad03ba6dc82c0ac692a3aa1f9
Issue Description:
The attached Xcode playground demonstrates this behavior. If two versions of a method exist that differ only in the optionality of the return type, the compiler should be able to choose the optional one when called within an if-let context. In Xcode 8 (8A218a), it's ambiguous without more context.
The text was updated successfully, but these errors were encountered: