File tree Expand file tree Collapse file tree 1 file changed +9
-13
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 1 file changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -1339,20 +1339,16 @@ class RefChecks extends MiniPhase { thisPhase =>
13391339 }
13401340
13411341 override def transformTypeTree (tree : TypeTree )(using Context ): TypeTree = {
1342- object CheckExperimental extends TypeTraverser {
1343- def traverse (tp : Type ): Unit =
1344- tp match {
1345- case tp : TypeRef =>
1346- checkDeprecated(tp.symbol, tree.srcPos)
1347- checkExperimental(tp.symbol, tree.srcPos)
1348- case tp : TermRef =>
1349- checkDeprecated(tp.symbol, tree.srcPos)
1350- checkExperimental(tp.symbol, tree.srcPos)
1351- case _ =>
1352- traverseChildren(tp)
1353- }
1342+ val tpe = tree.tpe
1343+ tpe.foreachPart {
1344+ case TypeRef (_, sym : Symbol ) =>
1345+ checkDeprecated(sym, tree.srcPos)
1346+ checkExperimental(sym, tree.srcPos)
1347+ case TermRef (_, sym : Symbol ) =>
1348+ checkDeprecated(sym, tree.srcPos)
1349+ checkExperimental(sym, tree.srcPos)
1350+ case _ =>
13541351 }
1355- CheckExperimental .traverse(tree.tpe)
13561352 tree
13571353 }
13581354
You can’t perform that action at this time.
0 commit comments