Hello Swift community:

Thank you for your reviews for my proposal. As you may have seen, this proposal 
contains two solutions originally:

Compiler magic
Compile-time checking
However even though Solution: Compiler magic is viable, according to some of 
feedback from several reviewers, a developer who is new to Swift would continue 
to be misled by the introduction of the automatic copy behavior:

from Xiaodi Wu xiaodi...@gmail.com <mailto:xiaodi...@gmail.com>:

A person who is new to Swift would continue to be confused if @NSCopying had 
magic but didSet and other behaviors did not. A person who has studied Swift 
and internalized the reasoning behind this initially tricky situation might 
rightly expect that all behaviors, including @NSCopying, are ignored during 
init.
from David Hart da...@hartbit.com <mailto:da...@hartbit.com>:

For the same reasons as Xiaodi, this proposal could be potentially misleading 
if it introduces custom compiler magic, warning or errors that was not 
replicated for future property behaviours.
For this consideration, I decided to lower the priority of Solution: Compiler 
magic to Alternatives Considered section and leave Solution: Compile-time 
checking as the only one major solution, which suggests that compiler warns the 
developers to call copy manually, rather than implicit magic:

Have compiler emit a compile-time error or warning if developers are performing 
an assignment operation from within an initializer between a property declared 
as @NSCopying and an instance of a protocol conforming class.
I’ve already submitted a pull-request for this modification.

Best,

Torin

Attachment: smime.p7s
Description: S/MIME cryptographic signature

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

Reply via email to