mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
parent
b3f503e0ce
commit
7c6695317c
@ -839,7 +839,8 @@ fn (mut c Checker) fail_if_immutable(expr ast.Expr) (string, token.Position) {
|
||||
if expr.obj is ast.Var {
|
||||
mut v := expr.obj as ast.Var
|
||||
if !v.is_mut && !c.pref.translated && !c.inside_unsafe {
|
||||
//c.error('`$expr.name` is immutable, declare it with `mut` to make it mutable', expr.pos)
|
||||
c.error('`$expr.name` is immutable, declare it with `mut` to make it mutable',
|
||||
expr.pos)
|
||||
}
|
||||
v.is_changed = true
|
||||
if v.typ.share() == .shared_t {
|
||||
|
@ -421,7 +421,7 @@ fn (mut g Gen) method_call(node ast.CallExpr) {
|
||||
}
|
||||
// TODO2
|
||||
unsafe {
|
||||
// g.generate_tmp_autofree_arg_vars(mut node, name)
|
||||
g.generate_tmp_autofree_arg_vars(mut node, name)
|
||||
}
|
||||
//
|
||||
// if node.receiver_type != 0 {
|
||||
@ -540,7 +540,7 @@ fn (mut g Gen) fn_call(node ast.CallExpr) {
|
||||
}
|
||||
// TODO2
|
||||
unsafe {
|
||||
// g.generate_tmp_autofree_arg_vars(mut node, name)
|
||||
g.generate_tmp_autofree_arg_vars(mut node, name)
|
||||
}
|
||||
// Handle `print(x)`
|
||||
if is_print && node.args[0].typ != table.string_type { // && !free_tmp_arg_vars {
|
||||
|
Loading…
Reference in New Issue
Block a user