# Confused by the behaviour of members in private extensions

**URL:** <https://forums.swift.org/t/confused-by-the-behaviour-of-members-in-private-extensions/47299>\
**Category:** Using Swift\
**Tags:** extensions, access-control\
**Created:** [April 10, 2021, 7:08am UTC](https://forums.swift.org/t/confused-by-the-behaviour-of-members-in-private-extensions/47299 "2021-04-10T07:08:14Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![tabsandspaces](https://avatars.discourse-cdn.com/v4/letter/t/3be4f8/32.png) [@tabsandspaces](https://forums.swift.org/u/tabsandspaces)\
**Post date:** [April 11, 2021, 2:10am UTC](https://forums.swift.org/t/confused-by-the-behaviour-of-members-in-private-extensions/47299/12 "2021-04-11T02:10:24Z")

</div>

> [@Nevin](#):
>
> This has been discussed previously, and Jordan Rose gives a good overview of how we got where we are in [this comment](https://forums.swift.org/t/function-in-private-extension-must-be-declared-private-because-it-uses-a-private-type/44463/8).
> 
> The upshot is, currently `private extension` and `fileprivate extension` are synonymous, even though [SE–0169](https://github.com/apple/swift-evolution/blob/main/proposals/0169-improve-interaction-between-private-declarations-and-extensions.md) “should” have given them distinct meanings.

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).

---

_[View the full topic](https://forums.swift.org/t/confused-by-the-behaviour-of-members-in-private-extensions/47299)._
