File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
compiler/src/dotty/tools/dotc/ast Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import reporting.trace
10
10
import dotty .tools .dotc .transform .SymUtils ._
11
11
import Decorators ._
12
12
import Constants .Constant
13
+ import scala .collection .mutable
13
14
14
15
import scala .annotation .tailrec
15
16
@@ -698,7 +699,10 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
698
699
699
700
/** The symbols defined locally in a statement list */
700
701
def localSyms (stats : List [Tree ])(using Context ): List [Symbol ] =
701
- for (stat <- stats if stat.isDef && stat.symbol.exists) yield stat.symbol
702
+ val locals = new mutable.ListBuffer [Symbol ]
703
+ for stat <- stats do
704
+ if stat.isDef && stat.symbol.exists then locals += stat.symbol
705
+ locals.toList
702
706
703
707
/** If `tree` is a DefTree, the symbol defined by it, otherwise NoSymbol */
704
708
def definedSym (tree : Tree )(using Context ): Symbol =
You can’t perform that action at this time.
0 commit comments