diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v index 00d3ed59e0..dc81518ce9 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -6242,7 +6242,9 @@ fn (mut c Checker) match_exprs(mut node ast.MatchExpr, cond_type_sym ast.TypeSym } else { remaining := unhandled.len - c.match_exhaustive_cutoff_limit err_details += unhandled[0..c.match_exhaustive_cutoff_limit].join(', ') - err_details += ', and $remaining others ...' + if remaining > 0 { + err_details += ', and $remaining others ...' + } } err_details += ' or `else {}` at the end)' } else {