> On Jun 13, 2016, at 9:45 AM, Joe Groff via swift-users
> <swift-users@swift.org> wrote:
>
> It's not undefined behavior in that we try to ensure that memory safety is
> still preserved when inout parameters alias, but it is *unspecified* when
> updates to an inout parameter will be written back to the original argument.
But it seems that memory safety was broken in that an array assigned to a ‘let’
variable was mutated. Doesn’t that violate the contract of its immutability?
Edited version of the example:
>> let acopy = a
>> print(acopy) // prints "[1, 2, 3]"
>> b = 99
>> print(acopy) // prints "[1, 2, 99]" (e.g. a let variable changed!)
—Jens
_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users