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

compiler: add const to typo suggestions + small typo format update

This commit is contained in:
joe-conigliaro
2019-10-25 18:26:14 +11:00
committed by Alexander Medvednikov
parent d4c1bba856
commit 4443fef6c3
2 changed files with 43 additions and 14 deletions

View File

@ -1820,9 +1820,10 @@ fn (p mut Parser) get_undefined_fn_type(name string, orig_name string) string {
}
// check for misspelled function / variable / module
suggested := p.identify_typo(name, p.import_table)
if suggested != '' {
p.error('undefined function: `$name`. did you mean: `$suggested`')
name_dotted := mod_gen_name_rev(name.replace('__', '.'))
suggested := p.identify_typo(name)
if suggested.len != 0 {
p.error('undefined: `$name_dotted`. did you mean:\n$suggested\n')
}
// If orig_name is a mod, then printing undefined: `mod` tells us nothing