We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9f0dd66 commit c5ce6beCopy full SHA for c5ce6be
compiler/src/dotty/tools/dotc/ast/Trees.scala
@@ -846,7 +846,11 @@ object Trees {
846
override def isEmpty: Boolean = trees.isEmpty
847
override def toList: List[Tree[T]] = flatten(trees)
848
override def toString: String = if (isEmpty) "EmptyTree" else "Thicket(" + trees.mkString(", ") + ")"
849
- override def span: Span = trees.foldLeft(NoSpan) ((span, t) => span union t.span)
+ override def span: Span =
850
+ def combine(s: Span, ts: List[Tree[T]]): Span = ts match
851
+ case t :: ts1 => combine(s.union(t.span), ts1)
852
+ case nil => s
853
+ combine(NoSpan, trees)
854
855
override def withSpan(span: Span): this.type =
856
mapElems(_.withSpan(span)).asInstanceOf[this.type]
0 commit comments