diff --git a/vlib/v/parser/fn.v b/vlib/v/parser/fn.v index 9639f52790..9f735bbced 100644 --- a/vlib/v/parser/fn.v +++ b/vlib/v/parser/fn.v @@ -191,7 +191,7 @@ fn (mut p Parser) fn_decl() ast.FnDecl { name = p.prepend_mod(name) } if _ := p.table.find_fn(name) { - p.error('redefinition of `$name`') + p.error('redefinition of function `$name`') } p.table.register_fn(table.Fn{ name: name diff --git a/vlib/v/parser/for.v b/vlib/v/parser/for.v index 3d6e8b3198..5ca4e2815b 100644 --- a/vlib/v/parser/for.v +++ b/vlib/v/parser/for.v @@ -74,21 +74,21 @@ fn (mut p Parser) for_stmt() ast.Stmt { key_var_name = val_var_name val_var_name = p.check_name() if p.scope.known_var(key_var_name) { - p.error('redefinition of `$key_var_name`') + p.error('redefinition of key iteration variable `$key_var_name`') } if p.scope.known_var(val_var_name) { - p.error('redefinition of `$val_var_name`') + p.error('redefinition of value iteration variable `$val_var_name`') } p.scope.register(key_var_name, ast.Var{ name: key_var_name typ: table.int_type }) } else if p.scope.known_var(val_var_name) { - p.error('redefinition of `$val_var_name`') + p.error('redefinition of value iteration variable `$val_var_name`') } p.check(.key_in) if p.tok.kind == .name && p.tok.lit in [key_var_name, val_var_name] { - p.error('redefinition of `$p.tok.lit`') + p.error('in a `for x in array` loop, the key or value iteration variable `$p.tok.lit` can not be the same as the array variable') } // arr_expr cond := p.expr(0)