v.checker: small cleanup for incomplete match errors

pull/10922/head
Delyan Angelov 2021-07-24 10:23:44 +03:00
parent 72c56ccc85
commit b9771ea120
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
1 changed files with 3 additions and 1 deletions

View File

@ -6242,7 +6242,9 @@ fn (mut c Checker) match_exprs(mut node ast.MatchExpr, cond_type_sym ast.TypeSym
} else { } else {
remaining := unhandled.len - c.match_exhaustive_cutoff_limit remaining := unhandled.len - c.match_exhaustive_cutoff_limit
err_details += unhandled[0..c.match_exhaustive_cutoff_limit].join(', ') 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)' err_details += ' or `else {}` at the end)'
} else { } else {