We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
null
1 parent 48b6b56 commit 29dbb82Copy full SHA for 29dbb82
compiler/src/dotty/tools/dotc/transform/patmat/Space.scala
@@ -904,12 +904,13 @@ class SpaceEngine(using Context) extends SpaceLogic {
904
// If explicit nulls are enabled, this check isn't needed because most of the cases
905
// that would trigger it would also trigger unreachability warnings.
906
if (!ctx.explicitNulls && i == cases.length - 1 && !isNullLit(pat) ) {
907
- dedup(flatten(simplify(minus(covered, prevs)))).toList match {
+ val spaces = flatten(simplify(minus(covered, prevs)))
908
+ if spaces.lengthCompare(10) < 0 then
909
+ dedup(spaces).toList match
910
case Typ(`constantNullType`, _) :: Nil =>
911
report.warning(MatchCaseOnlyNullWarning(), pat.srcPos)
912
case s =>
913
debug.println("`_` matches = " + s)
- }
914
}
915
916
0 commit comments