[SR-8896] Strange priorities of overloaded functions #51402
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
feature
A feature request or implementation
type checker
Area → compiler: Semantic analysis
Environment
Xcode Version 10.0 (10A255)
Additional Detail from JIRA
md5: f29a7e269390faed1efed185be434365
Issue Description:
I think the result of the following code is strange.
It seems that non-generic functions are always prior to generic functions between overloads.
It is a more realistic case that `PartialKeyPath` is selected prior to `KeyPath` in the situation like below.
In addition, if both of `foo` functions in the first example are generic, `Cat`'s one is selected.
I think such behavior is confusing. Some languages, e.g. Kotlin, shows "Cat" for the code like the first example. Is this behavior in Swift intentional?
The text was updated successfully, but these errors were encountered: