mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
autofree: handle SelectorExpr receivers
This commit is contained in:
parent
22fdf76db5
commit
ed7413ee51
@ -1044,8 +1044,9 @@ pub fn (mut c Checker) call_expr(mut call_expr ast.CallExpr) table.Type {
|
||||
}
|
||||
call_expr.args[i].is_tmp_autofree = true
|
||||
}
|
||||
// TODO copy pasta from above
|
||||
if call_expr.receiver_type == table.string_type && !(call_expr.left is ast.Ident ||
|
||||
call_expr.left is ast.StringLiteral) {
|
||||
call_expr.left is ast.StringLiteral || call_expr.left is ast.SelectorExpr) {
|
||||
call_expr.free_receiver = true
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user