File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
compiler/src/dotty/tools/dotc/transform/patmat Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -904,12 +904,13 @@ class SpaceEngine(using Context) extends SpaceLogic {
904904 // If explicit nulls are enabled, this check isn't needed because most of the cases
905905 // that would trigger it would also trigger unreachability warnings.
906906 if (! ctx.explicitNulls && i == cases.length - 1 && ! isNullLit(pat) ) {
907- dedup(flatten(simplify(minus(covered, prevs)))).toList match {
907+ val spaces = flatten(simplify(minus(covered, prevs)))
908+ if spaces.lengthCompare(10 ) < 0 then
909+ dedup(spaces).toList match
908910 case Typ (`constantNullType`, _) :: Nil =>
909911 report.warning(MatchCaseOnlyNullWarning (), pat.srcPos)
910912 case s =>
911913 debug.println(" `_` matches = " + s)
912- }
913914 }
914915 }
915916 }
You can’t perform that action at this time.
0 commit comments