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
If you dig through the old discussion about SE-0110, takesIntPairFn(twoIntsFn) is expected to work. This was the compromise solution that was introduced in response to feedback about common idioms such as calling "map" on a dictionary and passing in a closure taking two parameters not working.
"takesIntPairFn(twoIntsFn)" also worked in Swift 4.0, before the FunctionType representation began to properly model parameters. This was an oversight. If you try a recent development snapshot, you'll notice that -swift-version 5 rejects this call:
bbb.swift:23:20: error: cannot convert value of type '((Int, Int)) -> Int' to expected argument type '(Int, Int) -> Int'
takesTwoIntsFn(intPairFn) // Prints "Two-ints-function!" (should be error)
^~~~~~~~~
Huh, I just realized that my command line target's Swift Language Version has been set to 4.2 while I've been switching between the default toolchain and the recent master dev snapshot (which I thoughtlessly just expected to use Swift 5) ... So I got the wrong impression about the Swift 5 behavior ... Happy to see that I made a stupid mistake and things have been moving in the right direction.
Environment
Xcode 10.1 default toolchain and dev snapshot 2018-12-06
Additional Detail from JIRA
md5: 3862c9fc9fd0e37c09b1a1ceccc19f38
Issue Description:
More details here.
The text was updated successfully, but these errors were encountered: