You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add clause for protected visibility from package objects
We usually have an access rule that the access to a protected member `foo` in class `C`
must be from somewhere nested in a subclass of `C`. But that fails if the member is
accessed from a package object `p.package`. In that case, the access does not need to be in
the same object, it just has to be in package `p`. This clause was previously missing
and is now added.
Why was this only recently discovered?
#18057 fixed an issue where toplevel protected members were always accessible
because explicit package object prefixes were added after the accessibility check was done,
and would re-establish the previous members without doing an accessibility check. The fix was
done by adding package objects first, then doing he rest of the checks. But that also means
that protected toplevel objects now get checked as members of their synthetic package object
instead of as members of their package.
The change here also makes specs2 compile again.
0 commit comments