[SR-13042] Optional promotion and pointers can interact in unexpected ways #55488
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
Additional Detail from JIRA
md5: 246d265bee81c5a9861926f83f62154f
Issue Description:
When combining overloaded functions, optionals and pointer types sometimes the function selected is not the one I would have expected as demonstrated in the following code fragment which does not compile.
I would have expected calling id with a UMP to favour the UMP? version over the UP? version not the reverse.
Adding type hints on the call or the return type or alternatively using .some(ump) on the call explicitly allows the above code to compile.
The text was updated successfully, but these errors were encountered: