To me, it appears that this is not explained in the documentation (though now that I have the information, I can see how the portion from TSPL that I quoted earlier might imply it). Is this the case? In particular, is there something that I should have read, that would have told me why the error I received referred to fileprivate
when I had, to my knowledge at the time, not given anything that access level? This was a fairly inscrutable error message for me, and I'd assume I'm more engaged in Swift's development history than the typical user.
I don't think we should expect a user, especially one new to access levels, to (be able to) become familiar with the current situation wrt SE-0169 (and potentially SE-0025, SE-0159, and others).
Basically, I'm unsure why TSPL's section "Private Members in Extensions" only mentions the case where the extension is in the same file as the class/struct/enum it extends, doesn't mention the opposite case, doesn't mention fileprivate
, and does not refer to protocol extensions at all (but then proceeds to use a protocol extension as the only code example).