This refactors how the implicit import is handled in order to retain more name scope information. As a consequence, private access control works better between api files and implementation files. Note though that this will also be essential for name poisoning between the API and implementation, as discussed in #3763.
In implementing this, I ran into a couple issues with namespaces that I think point to flaws in their handling. I've fixed some and added a TODO for the biggest issue (in check.cpp line 281-288), which relates to the handling of namespaces of direct imports which are first evaluated indirectly.
This refactors how the implicit import is handled in order to retain more name scope information. As a consequence, private access control works better between api files and implementation files. Note though that this will also be essential for name poisoning between the API and implementation, as discussed in #3763.
In implementing this, I ran into a couple issues with namespaces that I think point to flaws in their handling. I've fixed some and added a TODO for the biggest issue (in check.cpp line 281-288), which relates to the handling of namespaces of direct imports which are first evaluated indirectly.