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

V shell scripts

This commit is contained in:
Alexander Medvednikov
2019-10-15 18:08:46 +03:00
parent 96152510e5
commit 5cd38ec91b
6 changed files with 66 additions and 23 deletions

View File

@ -662,7 +662,12 @@ fn (p mut Parser) fn_call(f Fn, method_ph int, receiver_var, receiver_type strin
//println('r=$receiver.typ RT=$receiver_type')
if receiver.is_mut && !p.expr_var.is_mut {
//println('$method_call recv=$receiver.name recv_mut=$receiver.is_mut')
p.error('`$p.expr_var.name` is immutable, declare it with `mut`')
if p.expr_var.is_for_var {
p.error('`$p.expr_var.name` is immutable, `for` variables' +
' always are')
} else {
p.error('`$p.expr_var.name` is immutable, declare it with `mut`')
}
}
if !p.expr_var.is_changed {
p.mark_var_changed(p.expr_var)