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
1010import dotty .tools .dotc .transform .SymUtils ._
1111import Decorators ._
1212import Constants .Constant
13+ import scala .collection .mutable
1314
1415import scala .annotation .tailrec
1516
@@ -698,7 +699,10 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
698699
699700 /** The symbols defined locally in a statement list */
700701 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
702706
703707 /** If `tree` is a DefTree, the symbol defined by it, otherwise NoSymbol */
704708 def definedSym (tree : Tree )(using Context ): Symbol =
You can’t perform that action at this time.
0 commit comments