[SR-2812] Swift 3's overload resolution for closure arguments differs from Swift 2.x #45416
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
regression
swift 3.0
Environment
Swift 4.0
Additional Detail from JIRA
md5: 0849862e65da6ea9ebd4d576385c291d
Issue Description:
Function overload resolution behavior has changed in Swift 3 regarding picking the most narrow available overload for closure types. For example:
In Swift 2.x this prints "Narrow", but in Swift 3.0 it prints "Wide." If the argument were of type
Int
instead of an(Int) -> Int
(and the function was called with an appropriate argument) it would print "Narrow" under both Swift 3 and Swift 2.x. Not sure if this change was intentional or not but I didn't see it mentioned in any swift-evolution proposal or otherwise documented.The text was updated successfully, but these errors were encountered: