Swift should provide truly immutable arrays

Originator:arkadiusz.holko
Number:rdar://17213247 Date Originated:07-Jun-2014 10:58 AM
Status:Duplicate Resolved:Duplicate of 17192555 (Closed)
Product:Developer Tools Product Version:8.0
Classification: Reproducible:
 
Summary:
Let's run this simple example in playground:
let arr = [1, 2, 3]
arr[0] = 3
arr // returns [3,2,3]

Expected Results:
Changing of elements shouldn't be allowed for arrays created with "let".

Actual Results:
Array is seemingly immutable, but we can change elements.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!