FWIW, I don't actually think this is that big of a footgun, which is why I'm also comfortable with the synthesized witnesses in the same-name case. I wanted to question what it is that we're protecting against with the synthesized witness that isn't also a problem for the "simple forwarding wrapper."
I guess the reason it seems more pertinent in this revision is because we're attempting to address the protocol conformance situation head-on. I was happy with the previous proposal, with the expectation that somewhere down the line, when we addressed protocol conformances with wrapped-argument functions, I'd likely be advocating for the same solution I am now.
My interpretation was that this revision presents the following (complete) answer for the protocol conformance question: functions with implementation-detail argument wrappers may satisfy protocol requirements without wrappers, but otherwise the wrappers must match. Is that accurate?
Are you talking about the same-name or different-name case here? In the different-name case, writing a wrapper function is exactly the first step I'd expect someone to take when implementing a conformance. In the same-name case, yeah, the first step is probably to write extension S: P {}
, then get an error about "argument wrapper mismatch," but the very next attempt (I expect) would be to write out the requirement signature (without wrappers), at which point the user would get the "invalid redeclaration" error, and then what?
I see, so am I understanding the line of thought here correctly as "even if we synthesize the witness, if @Foo
is a wrapper with no init(wrappedValue:)
(but with an init(projectedValue:)
) then we'd still have a situation where the user cannot (easily) write out a conformance by hand"?
I think I'm missing what solution this revision provides for such property wrappers. After all, like you said, the "new thing" in this revision is the implementation-detail wrapper which AFAICT must support init(wrappedValue:)
.