Closed scabug closed 11 years ago
Imported From: https://issues.scala-lang.org/browse/SI-6216?orig=1 Reporter: Greg Orzell (gorzell) Affected Versions: 2.9.1, 2.9.2
@magarciaEPFL said: Please provide a self-contained example, otherwise we can't even look at this. The provided Java class depends on DynamicProperty which in turn depends on a load of other stuff.
Greg Orzell (gorzell) said (edited on Aug 14, 2012 10:07:09 PM UTC): fully contained code can be found here: https://github.com/gorzell/archaius/commit/3fd6ae3545201723c47b3faebc370ccda717dd64 I will try to come up with a more limited example, but since I don't know what is causing the failure it could be tough.
Greg Orzell (gorzell) said: I believe that the root cause here was that i was trying to extend a class with a package protected constructor from outside the package, but the compiler just choking doesn't make that very clear.
@jsalvata said: I've hit this without involvement of a Java class -- just scala code:
object Test {
sealed class Result private(val id: Short, val isFinal: Boolean)
case class Ok() extends Result(1, true)
}
(I intended "private[Test]" -- easy to get it wrong)
@jsalvata said: I've removed the "java-interop" tag, since my example doesn't (seem to) involve any Java interoperability.
I've changed the summary to what I believe are the common aspects of both reported cases.
@paulp said: In 2.10 your example fails correctly. I expect the other one does as well.
<console>:9: error: constructor Result in class Result cannot be accessed in class Ok
case class Ok() extends Result(1, true)
^
Compiler throws an error trying to compile the declaration line of a scala subclass of a java super class.
Java Class
Scala Class: