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
i can see that. Now maybe there is some other problem that made it look
like a long class ??
in any case
why not something like below (that i tested) changing Int to Tree, and
where this would stack overflow for me implemented as in dotty.
@tailrec def pullOut(accum: List[Int], stats: List[Int]):
(Option[Int], List[Int]) = stats match {
case (i: Int) :: rest if i == 500 => (Some(i), accum.reverse ::: rest)
case first :: rest => pullOut(first :: accum, rest)
case Nil => (None, accum)
}
val ar = List(500).reverse_:::(Array.fill(50000)(0).toList)
val (r, _) = pullOut(Nil, ar)
assert(r == Some(500))
Compiler version
Minimized code
proprietary company code and not narrowed don
Output (click arrow to expand)
[error] java.lang.StackOverflowError
[error] dotty.tools.dotc.parsing.JavaParsers$JavaParser.pullOutFirstConstr$1(JavaParsers.scala:119)
[error] dotty.tools.dotc.parsing.JavaParsers$JavaParser.pullOutFirstConstr$1(JavaParsers.scala:119)
[error] dotty.tools.dotc.parsing.JavaParsers$JavaParser.pullOutFirstConstr$1(JavaParsers.scala:119)
[error] dotty.tools.dotc.parsing.JavaParsers$JavaParser.pullOutFirstConstr$1(JavaParsers.scala:119)
[error] dotty.tools.dotc.parsing.JavaParsers$JavaParser.pullOutFirstConstr$1(JavaParsers.scala:119)
....
The text was updated successfully, but these errors were encountered: