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
packagebar:private[bar] objectBarpackagefoo:importbar.Bar// no errorval_=Bar// error: not found (import is a no-op)val_= bar.Bar// error: access modifier
Output
-- [E006] NotFoundError: minim.scala:6:11------------------------------------6|val_=Bar// error: not found (import is a no-op)|^^^|Notfound: Bar|| longer explanation available when compiling with`-explain`-- [E173] ReferenceError: minim.scala:7:15------------------------------------7|val_= bar.Bar// error: access modifier|^^^^^^^|objectBar cannot be accessed asa member of bar.type from the top-level definitions in packagefoo.
|private[bar] objectBar can only be accessed from packagebar.
2 errors found
Expectation
Have an error when importing an object that is not accessible from the current scope
The text was updated successfully, but these errors were encountered:
Might be tricky without forcing the enclosing foo. But since there is a typer error, you don't get an unused import (which could do an additional check).
I often mix up that importable implies accessible (per spec); for inheritance, matching requires non-private.
Compiler version
c4531d4
Minimized code
Output
Expectation
Have an error when importing an object that is not accessible from the current scope
The text was updated successfully, but these errors were encountered: