@@ -844,11 +844,12 @@ extends Message(LossyWideningConstantConversionID):
844844 |Write `.to $targetType` instead. """
845845 def explain (using Context ) = " "
846846
847- class PatternMatchExhaustivity (val uncovered : Seq [String ], tree : untpd.Match )(using Context )
847+ class PatternMatchExhaustivity (uncoveredCases : Seq [String ], tree : untpd.Match )(using Context )
848848extends Message (PatternMatchExhaustivityID ) {
849849 def kind = MessageKind .PatternMatchExhaustivity
850850
851- private val hasMore = uncovered.lengthCompare(6 ) > 0
851+ private val hasMore = uncoveredCases.lengthCompare(6 ) > 0
852+ val uncovered = uncoveredCases.take(6 ).mkString(" , " )
852853
853854 def msg (using Context ) =
854855 val addendum = if hasMore then " (More unmatched cases are elided)" else " "
@@ -870,10 +871,10 @@ extends Message(PatternMatchExhaustivityID) {
870871 val endPos = tree.cases.lastOption.map(_.endPos).getOrElse(tree.selector.endPos)
871872 val startColumn = tree.cases.lastOption.map(_.startPos.startColumn).getOrElse(tree.selector.startPos.startColumn + 2 )
872873 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 " , " " )),
874875 )
875876 List (
876- CodeAction (title = s " Insert missing cases ( ${uncovered .size}) " ,
877+ CodeAction (title = s " Insert missing cases ( ${uncoveredCases .size}) " ,
877878 description = None ,
878879 patches = pathes
879880 )
0 commit comments