> On Mar 31, 2016, at 11:49 PM, Patrick Pijnappel <patrickpijnap...@gmail.com> 
> wrote:
> 
> The modified version doesn't seem to change any of the results (on -O or 
> -Onone). Note that the problem is that it's not uniquely referenced inside 
> bar where it actually should be – that would mean that ownership is currently 
> not directly transferred right?

You're right, I'm sorry, I misread your original comment. If the ARC optimizer 
didn't transfer ownership, then it is correct for `isUniquelyReferenced` to be 
false inside `bar`, since the `foo` inside of `test` and the `foo` parameter to 
`bar` are semantically independent values. If this weren't the case, then `bar` 
could modify a COW value type and have its changes be seen back in `test`'s 
copy.

-Joe
_______________________________________________
swift-dev mailing list
swift-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-dev

Reply via email to