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 {
812812 }.apply(false , tp)
813813
814814 def checkExhaustivity (_match : Match ): Unit = {
815- val Match (sel, cases :+ last ) = _match
815+ val Match (sel, cases) = _match
816816 val selTyp = sel.tpe.widen.dealias
817817
818818 if (! exhaustivityCheckable(sel)) return
819819
820- val patternSpace = Or ((last :: cases).map({ x =>
820+ val patternSpace = Or (cases.foldLeft( List .empty[ Space ]) { (acc, x) =>
821821 val space = if (x.guard.isEmpty) project(x.pat) else Empty
822822 debug.println(s " ${x.pat.show} ====> ${show(space)}" )
823- space
824- }))
823+ space :: acc
824+ })
825825
826826 val checkGADTSAT = shouldCheckExamples(selTyp)
827827
You can’t perform that action at this time.
0 commit comments