Surprisingly, the code below prints SAME while the initializer should call the Z() constructor each time. How can I initialize the array using this method with distinct instances of Z?
import Foundation
class Z {
var i: Int = 0
}
var z: [Z] = [Z](repeating: Z(), count: 10)
if z[0] === z[1] {
print("SAME")
} else {
print("NOT SAME")
}