We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5cf997c commit e5ce083Copy full SHA for e5ce083
src/dotty/tools/dotc/core/Types.scala
@@ -3408,6 +3408,12 @@ object Types {
3408
}
3409
3410
3411
+ abstract class TypeTraverser(implicit ctx: Context) extends TypeAccumulator[Unit] {
3412
+ def traverse(tp: Type): Unit
3413
+ def apply(x: Unit, tp: Type): Unit = traverse(tp)
3414
+ protected def traverseChildren(tp: Type) = foldOver((), tp)
3415
+ }
3416
+
3417
class ExistsAccumulator(p: Type => Boolean)(implicit ctx: Context) extends TypeAccumulator[Boolean] {
3418
override def stopAtStatic = false
3419
def apply(x: Boolean, tp: Type) = x || p(tp) || foldOver(x, tp)
0 commit comments