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
=== What steps will reproduce the problem ===
Compile, under Scala 2.9.0.RC4 (and presumably earlier)
objectSubList {
implicitdefsublistable[A](x: List[A]) =newSubListable(x)
classSubListable[A](x: List[A]) {
defisSubListOf(y: List[A]) = {
x match {
caseNil=>truecase h :: t => y.contains(h) && (t.isSubListOf(y.drop(y.indexOf(h) +1)))
}
}
}
}
=== What is the expected behavior? ===
Some sort of error (e.g. along the lines of "recursive method isSubListOf requires a return type") presented to the user.
=== What do you see instead? ===
The compiler crashes with an AssertionError, e.g.
java.lang.AssertionError: assertion failed: y.indexOf(h).$$plus(1)
at scala.Predef$$.assert(Predef.scala:103)
at scala.tools.nsc.typechecker.SuperAccessors
$$SuperAccTransformer.transform(SuperAccessors.scala:236)
at scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer$$
$$anonfun$$1.apply(SuperAccessors.scala:48)
at scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer$$
$$anonfun$$1.apply(SuperAccessors.scala:45)
at scala.Tuple2$$Zipped$$$$anonfun$$map$$1.apply(Tuple2.scala:65)
at scala.Tuple2$$Zipped$$$$anonfun$$map$$1.apply(Tuple2.scala:63)
at scala.collection.LinearSeqOptimized
$$class.foreach(LinearSeqOptimized.scala:59)
at scala.collection.immutable.List.foreach(List.scala:45)
at scala.Tuple2$$Zipped.map(Tuple2.scala:63)
at scala.tools.nsc.typechecker.SuperAccessors
$$SuperAccTransformer.transformArgs(SuperAccessors.scala:45)
at scala.tools.nsc.typechecker.SuperAccessors
$$SuperAccTransformer.transform(SuperAccessors.scala:237)
at scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer$$
$$anonfun$$transformArgs$$1.apply(SuperAccessors.scala:50)
[...]
Error during sbt execution: java.lang.AssertionError: assertion failed: y.indexOf(h).$$plus(1)
=== What steps will reproduce the problem ===
Compile, under Scala 2.9.0.RC4 (and presumably earlier)
=== What is the expected behavior? ===
Some sort of error (e.g. along the lines of "recursive method isSubListOf requires a return type") presented to the user.
=== What do you see instead? ===
The compiler crashes with an AssertionError, e.g.
=== Additional information ===
Originally posted at http://groups.google.com/group/scala-user/browse_thread/thread/42b042969c15a0a0
I'm not saying that this code should compile; just that the compiler should identify an error in the source, rather than crashing.
The text was updated successfully, but these errors were encountered: