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

checker: use 'mut' instead of 'var' in error message

This commit is contained in:
Larpon 2020-04-25 16:51:12 +02:00 committed by GitHub
parent a20bef65ba
commit 6a834c0528
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -402,7 +402,7 @@ fn (c mut Checker) assign_expr(assign_expr mut ast.AssignExpr) {
scope := c.file.scope.innermost(assign_expr.pos.pos)
if v := scope.find_var(it.name) {
if !v.is_mut {
c.error('`$it.name` is immutable, declare it with `var` to assign to it', assign_expr.pos)
c.error('`$it.name` is immutable, declare it with `mut` to assign to it', assign_expr.pos)
}
}
}