File tree 2 files changed +18
-2
lines changed
compiler/src/dotty/tools/dotc/ast
2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -712,8 +712,11 @@ object Trees {
712
712
override def toList : List [Tree [T ]] = flatten(trees)
713
713
override def toString = if (isEmpty) " EmptyTree" else " Thicket(" + trees.mkString(" , " ) + " )"
714
714
override def withPos (pos : Position ): this .type = {
715
- val newTrees = trees.map(_.withPos(pos))
716
- new Thicket [T ](newTrees).asInstanceOf [this .type ]
715
+ val newTrees = trees.mapConserve(_.withPos(pos))
716
+ if (trees eq newTrees)
717
+ this
718
+ else
719
+ new Thicket [T ](newTrees).asInstanceOf [this .type ]
717
720
}
718
721
override def pos = (NoPosition /: trees) ((pos, t) => pos union t.pos)
719
722
override def foreachInThicket (op : Tree [T ] => Unit ): Unit =
Original file line number Diff line number Diff line change
1
+ object Test {
2
+ inline def crash () = {
3
+ try {
4
+ println(" hi" )
5
+ } catch {
6
+ case e : Exception =>
7
+ }
8
+ }
9
+
10
+ def main (args : Array [String ]): Unit = {
11
+ crash()
12
+ }
13
+ }
You can’t perform that action at this time.
0 commit comments