better `foo must return (int, int)` error
parent
cb46bf314e
commit
cca650c655
|
@ -171,12 +171,17 @@ fn (p mut Parser) print_error_context(){
|
|||
// p.scanner.debug_tokens()
|
||||
}
|
||||
|
||||
fn normalized_error( s string ) string {
|
||||
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…
Reference in New Issue