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.
However, the option for 5 is lacking from Xcode's UI, there's only 3, 4, 4.2 and unspecified, I've asked about this in a separate thread.
I just figured the overloaded-parentheses-and-single-element-tuples-thing might have something to do with things like the following printed function type representation SR-8235:
func f(_ a: Int, _ b: Int) {}
func g(_ pair: (Int, Int)) {}
func h(_ fn: (Int, Int) -> Void) {}
func i(_ fn: ((Int, Int)) -> Void) {}
func test() {
print(type(of: f)) // Prints (Int, Int) -> ()
print(type(of: g)) // Prints (Int, Int) -> () <--- bug?
print(type(of: h)) // Prints ((Int, Int) -> ()) -> ()
print(type(of: i)) // Prints ((Int, Int) -> ()) -> () <--- bug?
}
test()
I'm really sure this is the Swift 5 behavior this time.
$ cat > test.swift
func f(_ a: Int, _ b: Int) {}
func g(_ pair: (Int, Int)) {}
func h(_ fn: (Int, Int) -> Void) {}
func i(_ fn: ((Int, Int)) -> Void) {}
func test() {
print(type(of: f))
print(type(of: g))
print(type(of: h))
print(type(of: i))
}
test()
$ /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2018-12-06-a.xctoolchain/usr/bin/swiftc --version
Apple Swift version 5.0-dev (LLVM 491b123d06, Clang 9bb9e9884e, Swift 00d2acd809)
Target: x86_64-apple-darwin18.2.0
$ /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2018-12-06-a.xctoolchain/usr/bin/swiftc -swift-version 5 test.swift && ./test
(Int, Int) -> ()
(Int, Int) -> ()
((Int, Int) -> ()) -> ()
((Int, Int) -> ()) -> ()
$