Skip to content

Commit 4e92703

Browse files
authored
Merge pull request #7756 from dotty-staging/fix-#6533
Avoid nested IgnoredProtos
2 parents 3fa1fbe + 688f421 commit 4e92703

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,14 @@ object ProtoTypes {
113113
}
114114

115115
/** A class marking ignored prototypes that can be revealed by `deepenProto` */
116-
case class IgnoredProto(ignored: Type) extends UncachedGroundType with MatchAlways {
117-
override def revealIgnored = ignored.revealIgnored
116+
case class IgnoredProto(ignored: Type) extends UncachedGroundType with MatchAlways with
117+
override def revealIgnored = ignored
118118
override def deepenProto(implicit ctx: Context): Type = ignored
119-
}
119+
120+
object IgnoredProto with
121+
def apply(ignored: Type): IgnoredProto = ignored match
122+
case ignored: IgnoredProto => ignored
123+
case _ => new IgnoredProto(ignored)
120124

121125
/** A prototype for expressions [] that are part of a selection operation:
122126
*

0 commit comments

Comments
 (0)