Closed
Description
I have tried sbt console
as well as scala-cli console
, in both cases, generating some valid xml strings crashes with a StackOverflowError
. Running the same code without the console works as expected.
Also, generating a non-xml string just works ((1 to 200).foldRight("x") { case (_, n) => s"< $n >" }
).
Previously, I was able to generate a different error which I can't reproduce again because I can't find which Scala version I used in that session:
Compiler version
3.3.0
Minimized example
(1 to 200).foldRight("x") { case (_, n) => s"<x>$n</x>" }
Output
Exception in thread "main" java.lang.StackOverflowError
at dotty.tools.dotc.ast.untpd$UntypedTreeTraverser.apply(untpd.scala:808)
at dotty.tools.dotc.ast.untpd$UntypedTreeTraverser.apply(untpd.scala:808)
at dotty.tools.dotc.ast.Trees$Instance$TreeAccumulator.foldOver(Trees.scala:1545)
at dotty.tools.dotc.ast.untpd$UntypedTreeTraverser.traverseChildren(untpd.scala:809)
at dotty.tools.dotc.printing.SyntaxHighlighting$TreeHighlighter$2$.traverse(SyntaxHighlighting.scala:123)
at dotty.tools.dotc.ast.untpd$UntypedTreeTraverser.apply(untpd.scala:808)
at dotty.tools.dotc.ast.untpd$UntypedTreeTraverser.apply(untpd.scala:808)
at dotty.tools.dotc.ast.Trees$Instance$TreeAccumulator.foldOver(Trees.scala:1545)
at dotty.tools.dotc.ast.untpd$UntypedTreeTraverser.traverseChildren(untpd.scala:809)
at dotty.tools.dotc.printing.SyntaxHighlighting$TreeHighlighter$2$.traverse(SyntaxHighlighting.scala:123)
at dotty.tools.dotc.ast.untpd$UntypedTreeTraverser.apply(untpd.scala:808)
at dotty.tools.dotc.ast.untpd$UntypedTreeTraverser.apply(untpd.scala:808)
at dotty.tools.dotc.ast.Trees$Instance$TreeAccumulator.foldOver(Trees.scala:1545)
at dotty.tools.dotc.ast.untpd$UntypedTreeTraverser.traverseChildren(untpd.scala:809)
at dotty.tools.dotc.printing.SyntaxHighlighting$TreeHighlighter$2$.traverse(SyntaxHighlighting.scala:123)
at dotty.tools.dotc.ast.untpd$UntypedTreeTraverser.apply(untpd.scala:808)
at dotty.tools.dotc.ast.untpd$UntypedTreeTraverser.apply(untpd.scala:808)
at dotty.tools.dotc.ast.Trees$Instance$TreeAccumulator.foldOver(Trees.scala:1557)
at dotty.tools.dotc.ast.untpd$UntypedTreeTraverser.traverseChildren(untpd.scala:809)
at dotty.tools.dotc.printing.SyntaxHighlighting$TreeHighlighter$2$.traverse(SyntaxHighlighting.scala:123)
at dotty.tools.dotc.ast.untpd$UntypedTreeTraverser.apply(untpd.scala:808)
at dotty.tools.dotc.ast.untpd$UntypedTreeTraverser.apply(untpd.scala:808)
at dotty.tools.dotc.ast.Trees$Instance$TreeAccumulator.foldOver(Trees.scala:1545)
at dotty.tools.dotc.ast.untpd$UntypedTreeTraverser.traverseChildren(untpd.scala:809)
at dotty.tools.dotc.printing.SyntaxHighlighting$TreeHighlighter$2$.traverse(SyntaxHighlighting.scala:123)
at dotty.tools.dotc.ast.untpd$UntypedTreeTraverser.apply(untpd.scala:808)
at dotty.tools.dotc.ast.untpd$UntypedTreeTraverser.apply(untpd.scala:808)
at dotty.tools.dotc.ast.Trees$Instance$TreeAccumulator.foldOver(Trees.scala:1551)
at dotty.tools.dotc.ast.untpd$UntypedTreeTraverser.traverseChildren(untpd.scala:809)
at dotty.tools.dotc.printing.SyntaxHighlighting$TreeHighlighter$2$.traverse(SyntaxHighlighting.scala:123)
at dotty.tools.dotc.ast.untpd$UntypedTreeTraverser.apply(untpd.scala:808)
at dotty.tools.dotc.ast.untpd$UntypedTreeTraverser.apply(untpd.scala:808)
at dotty.tools.dotc.ast.Trees$Instance$TreeAccumulator.foldOver(Trees.scala:1565)
at dotty.tools.dotc.ast.untpd$UntypedTreeTraverser.traverseChildren(untpd.scala:809)
at dotty.tools.dotc.printing.SyntaxHighlighting$TreeHighlighter$2$.traverse(SyntaxHighlighting.scala:123)
Expectation
The console mustn't crash.