Wenn a ist identisch mit c, ist b identisch mit c, warum a ist nicht identisch mit b?Identität Operatoren in Swift
var a = [1, 2, 3]
var b = a
var c = a[0...2]
a === c // true
b === c // true
a === b // false
Wenn a, b, c Konstanten sind:
let a = [1, 2, 3]
let b = a
let c = a[0...2]
a === c // true
b === c // true
a === b // true
Vielen Dank und @onevcat. Ich habe meinen Code in eine .swift-Datei kopiert und im Terminal ausgeführt, alle Tests sind wahr. – Tao
Radar eingereicht: http://openradar.appspot.com/radar?id=6240029269557248 rdar: // 17192099 –