From b9771ea120f6d11cceb28bd801626f5f2a4febd3 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sat, 24 Jul 2021 10:23:44 +0300 Subject: [PATCH] v.checker: small cleanup for incomplete match errors --- vlib/v/checker/checker.v | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 {