File tree Expand file tree Collapse file tree 1 file changed +1
-7
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 1 file changed +1
-7
lines changed Original file line number Diff line number Diff line change @@ -791,12 +791,6 @@ object PatternMatcher {
791
791
* plan and following onSuccess plans.
792
792
*/
793
793
private def collectSwitchCases (plan : TestPlan ): List [Plan ] = {
794
- def isSwitchableType (tpe : Type ): Boolean =
795
- (tpe isRef defn.IntClass ) ||
796
- (tpe isRef defn.ByteClass ) ||
797
- (tpe isRef defn.ShortClass ) ||
798
- (tpe isRef defn.CharClass )
799
-
800
794
val scrutinee = plan.scrutinee
801
795
802
796
def isIntConst (tree : Tree ) = tree match {
@@ -811,7 +805,7 @@ object PatternMatcher {
811
805
case _ =>
812
806
plan :: Nil
813
807
}
814
- if (isSwitchableType( scrutinee.tpe) ) recur(plan)
808
+ if (scrutinee.tpe.widen.classSymbol ne defn. AnyClass ) recur(plan)
815
809
else Nil
816
810
}
817
811
You can’t perform that action at this time.
0 commit comments