1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

checker: check match for exhaustion

This commit is contained in:
Daniel Däschle
2020-04-14 01:03:31 +02:00
committed by GitHub
parent 1185f04868
commit 12e48c6fe2
8 changed files with 57 additions and 12 deletions

View File

@@ -96,7 +96,9 @@ pub fn formatted_error(kind string /*error or warn*/, emsg string, filepath stri
continue
}
if pos.len > 1 {
underline := '~'.repeat(pos.len)
max_len := sline.len - pointerline.len // rest of the line
len := if pos.len > max_len { max_len } else { pos.len }
underline := '~'.repeat(len)
pointerline << if emanager.support_color { term.bold(term.blue(underline)) } else { underline }
}else{
pointerline << if emanager.support_color { term.bold(term.blue('^')) } else { '^' }