mirror of
https://github.com/vlang/v.git
synced 2025-09-15 23:42:28 +03:00
better foo must return (int, int)
error
This commit is contained in:
parent
cb46bf314e
commit
cca650c655
1 changed files with 14 additions and 9 deletions
|
@ -173,10 +173,15 @@ fn (p mut Parser) print_error_context(){
|
|||
|
||||
fn normalized_error(s string) string {
|
||||
// Print `[]int` instead of `array_int` in errors
|
||||
return s.replace('array_', '[]')
|
||||
mut res := s.replace('array_', '[]')
|
||||
.replace('__', '.')
|
||||
.replace('Option_', '?')
|
||||
.replace('main.', '')
|
||||
if res.contains('_V_MulRet_') {
|
||||
res = res.replace('_V_MulRet_', '(').replace('_V_', ', ')
|
||||
res = res[..res.len-1] + ')"'
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue