File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 2 files changed +10
-8
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 =
Original file line number Diff line number Diff line change @@ -828,13 +828,11 @@ object RefChecks {
828
828
* in either a deprecated member or a scala bridge method, issue a warning.
829
829
*/
830
830
private def checkDeprecated (sym : Symbol , pos : SourcePosition )(using Context ): Unit =
831
- for
832
- annot <- sym.getAnnotation(defn.DeprecatedAnnot )
833
- if ! ctx.owner.ownersIterator.exists(_.isDeprecated)
834
- do
835
- val msg = annot.argumentConstant(0 ).map(" : " + _.stringValue).getOrElse(" " )
836
- val since = annot.argumentConstant(1 ).map(" since " + _.stringValue).getOrElse(" " )
837
- report.deprecationWarning(s " ${sym.showLocated} is deprecated ${since}${msg}" , pos)
831
+ for annot <- sym.getAnnotation(defn.DeprecatedAnnot ) do
832
+ if ! ctx.owner.ownersIterator.exists(_.isDeprecated) then
833
+ val msg = annot.argumentConstant(0 ).map(" : " + _.stringValue).getOrElse(" " )
834
+ val since = annot.argumentConstant(1 ).map(" since " + _.stringValue).getOrElse(" " )
835
+ report.deprecationWarning(s " ${sym.showLocated} is deprecated ${since}${msg}" , pos)
838
836
839
837
/** If @migration is present (indicating that the symbol has changed semantics between versions),
840
838
* emit a warning.
You can’t perform that action at this time.
0 commit comments