File tree 1 file changed +9
-13
lines changed
compiler/src/dotty/tools/dotc/typer
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 =>
1339
1339
}
1340
1340
1341
1341
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 _ =>
1354
1351
}
1355
- CheckExperimental .traverse(tree.tpe)
1356
1352
tree
1357
1353
}
1358
1354
You can’t perform that action at this time.
0 commit comments