@@ -844,11 +844,12 @@ extends Message(LossyWideningConstantConversionID):
844
844
|Write `.to $targetType` instead. """
845
845
def explain (using Context ) = " "
846
846
847
- class PatternMatchExhaustivity (val uncovered : Seq [String ], tree : untpd.Match )(using Context )
847
+ class PatternMatchExhaustivity (uncoveredCases : Seq [String ], tree : untpd.Match )(using Context )
848
848
extends Message (PatternMatchExhaustivityID ) {
849
849
def kind = MessageKind .PatternMatchExhaustivity
850
850
851
- private val hasMore = uncovered.lengthCompare(6 ) > 0
851
+ private val hasMore = uncoveredCases.lengthCompare(6 ) > 0
852
+ val uncovered = uncoveredCases.take(6 ).mkString(" , " )
852
853
853
854
def msg (using Context ) =
854
855
val addendum = if hasMore then " (More unmatched cases are elided)" else " "
@@ -870,10 +871,10 @@ extends Message(PatternMatchExhaustivityID) {
870
871
val endPos = tree.cases.lastOption.map(_.endPos).getOrElse(tree.selector.endPos)
871
872
val startColumn = tree.cases.lastOption.map(_.startPos.startColumn).getOrElse(tree.selector.startPos.startColumn + 2 )
872
873
val pathes = List (
873
- ActionPatch (endPos, uncovered .map(c=> indent(s " case $c => ??? " , startColumn)).mkString(" \n " , " \n " , " " )),
874
+ ActionPatch (endPos, uncoveredCases .map(c=> indent(s " case $c => ??? " , startColumn)).mkString(" \n " , " \n " , " " )),
874
875
)
875
876
List (
876
- CodeAction (title = s " Insert missing cases ( ${uncovered .size}) " ,
877
+ CodeAction (title = s " Insert missing cases ( ${uncoveredCases .size}) " ,
877
878
description = None ,
878
879
patches = pathes
879
880
)
0 commit comments