Skip to content

Commit c6e1820

Browse files
committed
Simplify Trees.flatten
Also: fix error annotations in test
1 parent 6229b48 commit c6e1820

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

compiler/src/dotty/tools/dotc/ast/Trees.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -779,9 +779,8 @@ object Trees {
779779
buf += scanned.head
780780
scanned = scanned.tail
781781
}
782-
recur(buf, remaining)
783782
}
784-
else recur(recur(buf, elems), remaining1)
783+
recur(recur(buf, elems), remaining1)
785784
case tree :: remaining1 =>
786785
if (buf != null) buf += tree
787786
recur(buf, remaining1)

tests/neg/parser-stability-17.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
trait x0[] { x0: x0 => }
2-
class x0[x1] extends x0[x0 x0] x2 x0
1+
trait x0[] { x0: x0 => } // error // error
2+
class x0[x1] extends x0[x0 x0] x2 x0 // error // error

0 commit comments

Comments
 (0)