With Xcode 6.1.1, run xcrun swift, and then:
1> let a: [String] = []
a: [String] = 0 values
2> let b = Array<String>()
b: [String] = 0 values
3> let c = [String]()
c: [(String)] = 0 values
Why was c initialised to an array of 1-tuples?
With Xcode 6.1.1, run xcrun swift, and then:
1> let a: [String] = []
a: [String] = 0 values
2> let b = Array<String>()
b: [String] = 0 values
3> let c = [String]()
c: [(String)] = 0 values
Why was c initialised to an array of 1-tuples?
It's just a notation. You're looking into the sausage factory so you see the bits of sausage; that's the price of using the REPL. Ask yourself in what way a 1-tuple differs from its contents... It doesn't. It's still just an array of string:
1> var c = [String]()
c: [(String)] = 0 values
2> c.append("hello")
3> c
$R0: [(String)] = 1 value {
[0] = "hello"
}
So [0] = "hello". No tuples here.
(String)) and a single value (String) are indistinguishable.