New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiler crash trying to access private constructor #4685
Comments
Imported From: https://issues.scala-lang.org/browse/SI-4685?orig=1 |
Jan van der Vorst (janvandervorst) said: |
@paulp said: ?{val this: ?}? is an interesting thing to be looking for.
|
Norman Walsh (ndw) said: |
Norman Walsh (ndw) said: Off in some stale testing code, I had written val id = new InputDeclaration("input", false, DOCUMENT, "//*") As I'd made progress, I'd made the InputDeclaration constructor "protected[model]" and changed its arguments. The 2.8.1-final compiler objected: src/com/xmlcalabash/driver/Test.scala:29: error: overloaded method constructor InputDeclaration with alternatives: Removing my out-of-date and bogus testing code seems to have resolved the 2.9.0.1 compiler crash. Hope that helps. |
When trying to access a private constructor with more than one parameter the compiler crashes.
Can be reproduced with:
// file: Crash.scala
class Foo private (i: Int, j:Int)
class Bar {
val c = new Foo(1, 2)
}
// end file
$ scalac Crash.scala
error: java.lang.Error: Unexpected New
at scala.tools.nsc.symtab.SymbolTable.abort(SymbolTable.scala:35)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:725)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$genLoadArguments$1.apply(GenICode.scala:1226)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$genLoadArguments$1.apply(GenICode.scala:1224)
at scala.collection.LinearSeqOptimized$class.foldLeft(LinearSeqOptimized.scala:111)
at scala.collection.immutable.List.foldLeft(List.scala:45)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadArguments(GenICode.scala:1224)
$ scalac -version
Scala compiler version 2.9.0.1 -- Copyright 2002-2011, LAMP/EPFL
The text was updated successfully, but these errors were encountered: