As someone who was against SE-0025 and SE-0169 I agree with @Nevin's conclusions:
-
Pre-SE-0025,
private
meantfileprivate
, and soprivate extension
meantfileprivate extension
. -
With SE-0025 (but not SE-0169), @xwu's explanation is correct:
private extension
is effectively stillfileprivate
because (a) applyingprivate
to all members would have been useless, and (b) it was a goal (though not one I agreed with) to makefileprivate
rare if people wanted it to be. Therefore, "private
means enclosing scope and that includes extensions, which are always at the top level of a file". -
With SE-0169,
private
for all methods in an extension became meaningful again…but it would be a source-breaking change to have those methods not exposed to other types in the file. Perhaps that change should have been made in Swift 5 as a breaking change, and I'd be in favor of making that change the next time we break source compatibility, with a corresponding deprecation ofprivate extension
in favor offileprivate extension
in existing language modes when we do.