-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Labels
fixed in Scala 3This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)minimizedpatmatruntime crash
Milestone
Description
=== What steps will reproduce the problem (please be specific and use wikiformatting)? ===
The following code crashes with a NoSuchMethodError
:
final class Outer {
sealed trait Inner
final case class Inner1(foo: Int) extends Inner
val inner: Outer#Inner = Inner1(0)
def bar = inner match {
case Inner1(i) => i
}
}
object Crash {
def main(args: Array[String]) {
println((new Outer).bar)
}
}
The crash does not happen when one of these changes is applied:
Inner
is asealed abstract class
instead of asealed trait
- the type of
val inner
is not a type projection but justInner
- the class
Inner1
is not marked final
The NoSuchMethodError
at runtime:
java.lang.NoSuchMethodError: Outer$$Inner1.Outer$$Inner1$$$$$$outer()LOuter;
at Outer.bar(finalcase.scala:9)
at Crash$$.main(finalcase.scala:16)
at Crash.main(finalcase.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at scala.tools.nsc.util.ScalaClassLoader$$$$anonfun$$run$$1.apply(ScalaClassLoader.scala:81)
at scala.tools.nsc.util.ScalaClassLoader$$class.asContext(ScalaClassLoader.scala:24)
at scala.tools.nsc.util.ScalaClassLoader$$URLClassLoader.asContext(ScalaClassLoader.scala:91)
at scala.tools.nsc.util.ScalaClassLoader$$class.run(ScalaClassLoader.scala:81)
at scala.tools.nsc.util.ScalaClassLoader$$URLClassLoader.run(ScalaClassLoader.scala:104)
at scala.tools.nsc.ObjectRunner$$.run(ObjectRunner.scala:33)
at scala.tools.nsc.ObjectRunner$$.runAndCatch(ObjectRunner.scala:40)
at scala.tools.nsc.MainGenericRunner$$.runTarget$$1(MainGenericRunner.scala:61)
at scala.tools.nsc.MainGenericRunner$$.process(MainGenericRunner.scala:85)
at scala.tools.nsc.MainGenericRunner$$.main(MainGenericRunner.scala:33)
at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
=== What versions of the following are you using? ===
- Scala: 2.9.0.RC1
- Java: 1.6.0_24
- Operating system: OS X 10.6.7
Metadata
Metadata
Assignees
Labels
fixed in Scala 3This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)minimizedpatmatruntime crash