diff --git a/compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala b/compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala index 9e379c6f7367..0e0bbc0d2f49 100644 --- a/compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala +++ b/compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala @@ -113,10 +113,14 @@ object ProtoTypes { } /** A class marking ignored prototypes that can be revealed by `deepenProto` */ - case class IgnoredProto(ignored: Type) extends UncachedGroundType with MatchAlways { - override def revealIgnored = ignored.revealIgnored + case class IgnoredProto(ignored: Type) extends UncachedGroundType with MatchAlways with + override def revealIgnored = ignored override def deepenProto(implicit ctx: Context): Type = ignored - } + + object IgnoredProto with + def apply(ignored: Type): IgnoredProto = ignored match + case ignored: IgnoredProto => ignored + case _ => new IgnoredProto(ignored) /** A prototype for expressions [] that are part of a selection operation: *