From ed7413ee51f002e83b76971bd2e3ec544081d288 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Sat, 21 Nov 2020 23:19:01 +0100 Subject: [PATCH] autofree: handle SelectorExpr receivers --- vlib/v/checker/checker.v | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v index 6b838c050c..5f5582d4f8 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -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 } }