> On Aug 27, 2016, at 9:28 AM, Jens Persson via swift-dev <swift-dev@swift.org> > wrote: > > IMHO Swift's handling of function types violate the principle of least > surprise. > > In the example program below, are `a` and `b` really of the same function > type? > > I searched but couldn't find any proposal or discussion addressing this. > > > // (Xcode 8 beta 6, toolchain: development snapshot 2016-08-26) > > let a: (Int, Int) -> Int = { (a, b) in a + b } > let b: ((Int, Int)) -> Int = a > // So `a` can be casted to `b`'s type, OK.
This is no longer intended to be the case in Swift 3. The former has two arguments, the latter has one argument. The implementation has not fully caught up with this change, though. -Joe _______________________________________________ swift-dev mailing list swift-dev@swift.org https://lists.swift.org/mailman/listinfo/swift-dev