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
peter@notebook:~/tmp/bug$$ scalac Package.scala
peter@notebook:~/tmp/bug$$ scala -cp .
Welcome to Scala version 2.8.0.RC2 (JavaHotSpot(TM) 64-BitServerVM, Java1.6.0_20).
Type in expressions to have them evaluated.
Type:help for more information.
scala>importexpr._importexpr._
scala>valv=newVar(1)
v: expr.package.Var= expr.package$$Var@1a659078
scala>valw=newVar(2)
w: expr.package.Var= expr.package$$Var@1d74f478
scala> v+w
Exception in thread "main" java.lang.AssertionError: assertion failed: List(objectpackage$$LExpr, objectpackage$$LExpr)
at scala.tools.nsc.symtab.Symbols$$Symbol.suchThat(Symbols.scala:1051)
at scala.tools.nsc.symtab.Symbols$$Symbol.companionModule0(Symbols.scala:1257)
at scala.tools.nsc.symtab.Symbols$$Symbol.companionModule(Symbols.scala:1265)
at scala.tools.nsc.backend.jvm.GenJVM$$BytecodeGenerator.javaName(GenJVM.scala:1751)
at scala.tools.nsc.backend.jvm.GenJVM$$BytecodeGenerator.javaType(GenJVM.scala:1841)
at scala.tools.nsc.backend.jvm.GenJVM$$BytecodeGenerator.javaType(GenJVM.scala:1845)
at scala.tools.nsc.backend.jvm.GenJVM$$BytecodeGenerator.genField(GenJVM.scala:600)
at scala.tools.nsc.backend.jvm.GenJVM$$BytecodeGenerator$$$$anonfun$$genClass$$3.apply(GenJVM.scala:257)
at scala.tools.nsc.backend.jvm.GenJVM$$BytecodeGenerator$$$$anonfun$$genClass$$3.apply(GenJVM.scala:257)
at scala.collection.LinearSeqOptimized$$class.foreach(LinearSeqOptimized.scala:62)
at scala.collection.immutable.List.foreach(List.scala:46)
at scala.tools.nsc.backend.jvm.GenJVM$$BytecodeGenerator.genClass(GenJVM.scala:257)
at scala.tools.nsc.backend.jvm.GenJVM$$JvmPhase.apply(GenJVM.scala:57)
at scala.tools.nsc.backend.jvm.GenJVM$$JvmPhase$$$$anonfun$$run$$3.apply(GenJVM.scala:53)
at scala.tools.nsc.backend.jvm.GenJVM$$JvmPhase$$$$anonfun$$run$$3.apply(GenJVM.scala:53)
at scala.collection.mutable.HashMap$$$$anon$$2$$$$anonfun$$foreach$$3.apply(HashMap.scala:90)
at scala.collection.mutable.HashMap$$$$anon$$2$$$$anonfun$$foreach$$3.apply(HashMap.scala:90)
at scala.collection.Iterator$$class.foreach(Iterator.scala:632)
at scala.collection.mutable.HashTable$$$$anon$$1.foreach(HashTable.scala:162)
at scala.collection.mutable.HashTable$$class.foreachEntry(HashTable.scala:195)
at scala.collection.mutable.HashMap.foreachEntry(HashMap.scala:40)
at scala.collection.mutable.HashMap$$$$anon$$2.foreach(HashMap.scala:90)
at scala.tools.nsc.backend.jvm.GenJVM$$JvmPhase.run(GenJVM.scala:53)
at scala.tools.nsc.Global$$Run.compileSources(Global.scala:729)
at scala.tools.nsc.Interpreter.compileAndSaveRun(Interpreter.scala:521)
at scala.tools.nsc.Interpreter$$Request.objRun(Interpreter.scala:893)
at scala.tools.nsc.Interpreter$$Request.compile(Interpreter.scala:916)
at scala.tools.nsc.Interpreter.interpret(Interpreter.scala:588)
at scala.tools.nsc.Interpreter.interpret(Interpreter.scala:580)
at scala.tools.nsc.InterpreterLoop.reallyInterpret$$1(InterpreterLoop.scala:481)
at scala.tools.nsc.InterpreterLoop.interpretStartingWith(InterpreterLoop.scala:518)
at scala.tools.nsc.InterpreterLoop.command(InterpreterLoop.scala:371)
at scala.tools.nsc.InterpreterLoop.processLine$$1(InterpreterLoop.scala:243)
at scala.tools.nsc.InterpreterLoop.repl(InterpreterLoop.scala:256)
at scala.tools.nsc.InterpreterLoop.main(InterpreterLoop.scala:555)
at scala.tools.nsc.MainGenericRunner$$.main(MainGenericRunner.scala:67)
at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
The same code. however, runs fine when compiled.
The text was updated successfully, but these errors were encountered:
And this also crashes the compiler. You can't overload in package objects and apparently you can't stash companions either. These limitations are no big deal, but it is a problem that the main route to finding out about them is crashing and/or things not compiling for no obvious reason.
@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.
Using scala 2.8.0.RC2 with Java 1.6.0_20 (on Ubuntu Linux), doing the following provokes a crash of the scala console.
Put the following code into a file called Pacakge.scala
Compile it and start a console session
The same code. however, runs fine when compiled.
The text was updated successfully, but these errors were encountered: