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
While playing with the latest 2.8 snapshot (r18215-b20090706020217 to be precise) I noticed that a package object containing a case class gets an assertion failure when re-compiling (i.e., the class files already exist from a previous run, even a previous build of the exact same source). A minimal test case:
package object foo {
case class X()
}
And the error:
Exception in thread "main" java.lang.AssertionError: assertion failed: List(object package$$X, object package$$X)
at scala.Predef$$.assert(Predef.scala:97)
at scala.tools.nsc.symtab.Symbols$$Symbol.suchThat(Symbols.scala:988)
at scala.tools.nsc.symtab.Symbols$$Symbol.linkedModuleOfClass(Symbols.scala:1159)
at scala.tools.nsc.backend.jvm.GenJVM$$BytecodeGenerator.genClass(GenJVM.scala:203)
at scala.tools.nsc.backend.jvm.GenJVM$$JvmPhase$$$$anonfun$$run$$2.apply(GenJVM.scala:50)
at scala.tools.nsc.backend.jvm.GenJVM$$JvmPhase$$$$anonfun$$run$$2.apply(GenJVM.scala:50)
at scala.collection.Iterator$$class.foreach(Iterator.scala:500)
at scala.collection.generic.MapTemplate$$$$anon$$4.foreach(MapTemplate.scala:156)
at scala.tools.nsc.backend.jvm.GenJVM$$JvmPhase.run(GenJVM.scala:50)
at scala.tools.nsc.Global$$Run.compileSources(Global.scala:781)
at scala.tools.nsc.Global$$Run.compile(Global.scala:855)
at scala.tools.nsc.Main$$.process(Main.scala:75)
at scala.tools.nsc.Main$$.main(Main.scala:89)
at scala.tools.nsc.Main.main(Main.scala)
A normal class does not cause the failure; nor does a case object.
The text was updated successfully, but these errors were encountered:
@paulp said:
(In r24311) Observed that some historical issues with package objects no longer
seem so issuey. In the interests of keeping the arbitrary limitations
to a minimum, re-enabled case classes in package objects (see #2130, #3437.)
Closes #3437, review by odersky.
While playing with the latest 2.8 snapshot (r18215-b20090706020217 to be precise) I noticed that a package object containing a case class gets an assertion failure when re-compiling (i.e., the class files already exist from a previous run, even a previous build of the exact same source). A minimal test case:
package object foo {
case class X()
}
And the error:
Exception in thread "main" java.lang.AssertionError: assertion failed: List(object package$$X, object package$$X)
at scala.Predef$$.assert(Predef.scala:97)
at scala.tools.nsc.symtab.Symbols$$Symbol.suchThat(Symbols.scala:988)
at scala.tools.nsc.symtab.Symbols$$Symbol.linkedModuleOfClass(Symbols.scala:1159)
at scala.tools.nsc.backend.jvm.GenJVM$$BytecodeGenerator.genClass(GenJVM.scala:203)
at scala.tools.nsc.backend.jvm.GenJVM$$JvmPhase$$$$anonfun$$run$$2.apply(GenJVM.scala:50)
at scala.tools.nsc.backend.jvm.GenJVM$$JvmPhase$$$$anonfun$$run$$2.apply(GenJVM.scala:50)
at scala.collection.Iterator$$class.foreach(Iterator.scala:500)
at scala.collection.generic.MapTemplate$$$$anon$$4.foreach(MapTemplate.scala:156)
at scala.tools.nsc.backend.jvm.GenJVM$$JvmPhase.run(GenJVM.scala:50)
at scala.tools.nsc.Global$$Run.compileSources(Global.scala:781)
at scala.tools.nsc.Global$$Run.compile(Global.scala:855)
at scala.tools.nsc.Main$$.process(Main.scala:75)
at scala.tools.nsc.Main$$.main(Main.scala:89)
at scala.tools.nsc.Main.main(Main.scala)
A normal class does not cause the failure; nor does a case object.
The text was updated successfully, but these errors were encountered: