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
When expanding the List to be sorted by examples/sort2.scala to some more values like val xs2 = List(6, 2, 8, 5, 112,-44,-22,109,56,-66,43,42,109,-111,2341) the program crashes with a StackOverFlowError.
As a scala beginner I have no idea if this error is due to the algorithm used in the example or if it reveals some bigger bug in Scala.
This is the stacktrace:
Exception in thread "main" java.lang.StackOverflowError
at scala.collection.mutable.ListBuffer.$plus$eq(ListBuffer.scala:115)
at scala.collection.mutable.ListBuffer.$plus$eq(ListBuffer.scala:42)
at scala.collection.TraversableLike$$anonfun$filter$1.apply(TraversableLike.scala:213)
at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
at scala.collection.immutable.List.foreach(List.scala:45)
at scala.collection.TraversableLike$class.filter(TraversableLike.scala:212)
at scala.collection.immutable.List.filter(List.scala:45)
at examples.sort2$.sort(sort2.scala:14)
The text was updated successfully, but these errors were encountered:
When expanding the List to be sorted by examples/sort2.scala to some more values like val xs2 = List(6, 2, 8, 5, 112,-44,-22,109,56,-66,43,42,109,-111,2341) the program crashes with a StackOverFlowError.
As a scala beginner I have no idea if this error is due to the algorithm used in the example or if it reveals some bigger bug in Scala.
This is the stacktrace:
Exception in thread "main" java.lang.StackOverflowError
at scala.collection.mutable.ListBuffer.$plus$eq(ListBuffer.scala:115)
at scala.collection.mutable.ListBuffer.$plus$eq(ListBuffer.scala:42)
at scala.collection.TraversableLike$$anonfun$filter$1.apply(TraversableLike.scala:213)
at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
at scala.collection.immutable.List.foreach(List.scala:45)
at scala.collection.TraversableLike$class.filter(TraversableLike.scala:212)
at scala.collection.immutable.List.filter(List.scala:45)
at examples.sort2$.sort(sort2.scala:14)
The text was updated successfully, but these errors were encountered: