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 {
904
904
// If explicit nulls are enabled, this check isn't needed because most of the cases
905
905
// that would trigger it would also trigger unreachability warnings.
906
906
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
908
910
case Typ (`constantNullType`, _) :: Nil =>
909
911
report.warning(MatchCaseOnlyNullWarning (), pat.srcPos)
910
912
case s =>
911
913
debug.println(" `_` matches = " + s)
912
- }
913
914
}
914
915
}
915
916
}
You can’t perform that action at this time.
0 commit comments