File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
compiler/src/dotty/tools/dotc/transform/patmat Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -865,14 +865,13 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
865865 }
866866
867867 /** Whehter counter-examples should be further checked? True for GADTs. */
868- def shouldCheckExamples (tp : Type ): Boolean = {
868+ private def shouldCheckExamples (tp : Type ): Boolean =
869869 new TypeAccumulator [Boolean ] {
870870 override def apply (b : Boolean , tp : Type ): Boolean = tp match {
871871 case tref : TypeRef if tref.symbol.is(TypeParam ) && variance != 1 => true
872872 case tp => b || foldOver(b, tp)
873873 }
874874 }.apply(false , tp)
875- }
876875
877876 def checkExhaustivity (_match : Match ): Unit = {
878877 val Match (sel, cases) = _match
@@ -904,14 +903,14 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
904903 val Match (sel, cases) = _match
905904 val selTyp = sel.tpe.widen.dealias
906905
907- def targetSpace : Space =
906+ if (! redundancyCheckable(sel)) return
907+
908+ val targetSpace =
908909 if (selTyp.classSymbol.isPrimitiveValueClass)
909910 Typ (selTyp, true )
910911 else
911912 Or (Typ (selTyp, true ) :: Typ (ConstantType (Constant (null ))) :: Nil )
912913
913- if (! redundancyCheckable(sel)) return
914-
915914 (0 until cases.length).foreach { i =>
916915 // in redundancy check, take guard as false in order to soundly approximate
917916 val prevs =
You can’t perform that action at this time.
0 commit comments