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
% ./bin/dotc Foo.scala Test.scala
Exception in thread "main" java.lang.AssertionError: assertion failed:
privateobjectFoo in Foo.scala accessed from
constructor Test$ in objectTest$ in Test.scala
at scala.Predef$.assert(Predef.scala:165)
at dotty.tools.dotc.transform.ExpandPrivate.ensurePrivateAccessible(ExpandPrivate.scala:75)
I'm able to reproduce this error on the latest Dotty master (318700f).
I bumped into this error while trying to compile https://github.com/johnynek/paiges with Dotty. The bug manifests in an uncaught exception during compilation
exception occurred while compiling tests/pos/private-object/Chunk.scala, tests/pos/private-object/Doc.scala
Exception in thread "main" java.lang.AssertionError: assertion failed: private object Chunk in package bar in tests/pos/private-object/Chunk.scala accessed from constructor Doc$ in object Doc in tests/pos/private-object/Doc.scala
at scala.Predef$.assert(Predef.scala:165)
at dotty.tools.dotc.transform.ExpandPrivate.ensurePrivateAccessible(ExpandPrivate.scala:90)
at dotty.tools.dotc.transform.ExpandPrivate.transformIdent(ExpandPrivate.scala:96)
at dotty.tools.dotc.transform.ExpandPrivate.transformIdent(ExpandPrivate.scala:39)
at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer.goIdent(TreeTransform.scala:562)
at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer.transformNamed(TreeTransform.scala:944)
at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer$$anonfun$transform$2.apply(TreeTransform.scala:1182)
at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer$$anonfun$transform$2.apply(TreeTransform.scala:1175)
at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:136)
at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:57)
Removing the private modifier "fixed" the problem.
Foo.scala
:Test.scala
:Note: here's how
scalac
compilesFoo.scala
:And here's how dotty does it:
The text was updated successfully, but these errors were encountered: