<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 13, 2016, at 9:45 AM, Joe Groff via swift-users &lt;<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family: Alegreya-Regular; font-size: 15px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">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.</span></div></blockquote><br class=""></div><div>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?</div><div class=""><br class=""></div>Edited version of the example:<br class=""><div class=""><blockquote type="cite" class=""><blockquote type="cite" class="">&nbsp; let acopy = a<br class="">&nbsp;print(acopy) &nbsp;// prints "[1, 2, 3]"<br class="">&nbsp; b = 99<br class="">&nbsp; print(acopy) &nbsp;// prints "[1, 2, 99]" (e.g. a let variable changed!)<br class=""></blockquote></blockquote></div><div class=""><br class=""></div><div class="">—Jens</div></body></html>