File tree 2 files changed +14
-2
lines changed
compiler/src/dotty/tools/dotc/transform/patmat
2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -773,7 +773,7 @@ object SpaceEngine {
773
773
}
774
774
775
775
private def exhaustivityCheckable (sel : Tree )(using Context ): Boolean = {
776
- val seen = collection.mutable.Set .empty[Type ]
776
+ val seen = collection.mutable.Set .empty[Symbol ]
777
777
778
778
// Possible to check everything, but be compatible with scalac by default
779
779
def isCheckable (tp : Type ): Boolean =
@@ -789,7 +789,7 @@ object SpaceEngine {
789
789
tpw.isRef(defn.BooleanClass ) ||
790
790
classSym.isAllOf(JavaEnum ) ||
791
791
classSym.is(Case ) && {
792
- if seen.add(tpw ) then productSelectorTypes(tpw, sel.srcPos).exists(isCheckable(_))
792
+ if seen.add(classSym ) then productSelectorTypes(tpw, sel.srcPos).exists(isCheckable(_))
793
793
else true // recursive case class: return true and other members can still fail the check
794
794
}
795
795
Original file line number Diff line number Diff line change
1
+ // minimised from github.com/Adam-Vandervorst/CZ2
2
+
3
+ import scala .collection .mutable
4
+
5
+ private trait EMImpl [V , F [_]]
6
+
7
+ case class EM [V2 ](apps : ExprMap [ExprMap [V2 ]]) extends EMImpl [V2 , EM ]:
8
+ def collect [W ](pf : PartialFunction [V2 , W ]): Unit =
9
+ val apps1 = apps.collect(_.collect(pf))
10
+
11
+ case class ExprMap [V ](var em : EM [V ] = null ) extends EMImpl [V , ExprMap ]:
12
+ def collect [W ](pf : PartialFunction [V , W ]): ExprMap [W ] = ??? // was: StackOverflow in isCheckable
You can’t perform that action at this time.
0 commit comments