It compiles to Swift ... but what is it?

I mistakenly typed something like this in Swift:

var a = [Int, Int, Int]()

      

and it compiles ... but I don't know what that might represent ...

Any ideas? Can anyone explain the semantic meaning of this?

Thank you, happy encoding for everyone,

+3


source to share


1 answer


This is an array of tuples of type (Int, Int, Int)

Consider the following:



var a = [Int, Int, Int]()
a.append(12, 1134, 124)
var first = a.first!
first.0 //= 12
first.1 //= 1134
first.2 //= 124

      

+5


source







All Articles