parser: a better [] error message

pull/2808/head
Alexander Medvednikov 2019-11-19 11:13:19 +03:00
parent fe81ccab20
commit 0cf232d692
1 changed files with 1 additions and 1 deletions

View File

@ -2436,7 +2436,7 @@ fn (p mut Parser) array_init() string {
p.tokens[p.token_idx-2].line_nr == p.tokens[p.token_idx-1].line_nr { // TODO
// vals.len == 0 {
if exp_array {
p.error('use `foo = []` instead of `foo = []Type`')
p.error('no need to specify the full array type here, use `[]` instead of `[]${p.expected_type[6..]}`')
}
typ = p.get_type()
} else if exp_array && i == 0 {