File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
compiler/src/dotty/tools/dotc/transform/patmat Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -812,16 +812,16 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
812
812
}.apply(false , tp)
813
813
814
814
def checkExhaustivity (_match : Match ): Unit = {
815
- val Match (sel, cases :+ last ) = _match
815
+ val Match (sel, cases) = _match
816
816
val selTyp = sel.tpe.widen.dealias
817
817
818
818
if (! exhaustivityCheckable(sel)) return
819
819
820
- val patternSpace = Or ((last :: cases).map({ x =>
820
+ val patternSpace = Or (cases.foldLeft( List .empty[ Space ]) { (acc, x) =>
821
821
val space = if (x.guard.isEmpty) project(x.pat) else Empty
822
822
debug.println(s " ${x.pat.show} ====> ${show(space)}" )
823
- space
824
- }))
823
+ space :: acc
824
+ })
825
825
826
826
val checkGADTSAT = shouldCheckExamples(selTyp)
827
827
You can’t perform that action at this time.
0 commit comments