One case that I can think of that would break this scheme is @Asserted
. In fact, at the beginning of the second revision of this proposal no transformation occurred at the call-site; property-wrapper transformation happened within the function, as I think was proposed in the first pitch. However, that proved to be problematic for wrappers that expect initialization at the call-site. In this case, @Asserted
requires call-site initialization for obtaining the file and line literals. All in all, function-local transformations seem to break some wrappers without any action by the author.
Thus, I think that a viable solution for protocols would be to require property-wrapper annotations in protocol requirements. If you think about it makes sense as well, because something like buy(quantity:of:)
(with an @Asserted
wrapper) would currently have a signature buy(quantity:of:file:line:)
.