From 87ed442d9e3a23e42cfbcad33dd09144035dc404 Mon Sep 17 00:00:00 2001 From: Henrixounez Date: Thu, 29 Aug 2019 23:36:29 +0200 Subject: [PATCH] compiler: nested structure print error fix --- compiler/fn.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/fn.v b/compiler/fn.v index ccaf1e1a07..535ccdaf67 100644 --- a/compiler/fn.v +++ b/compiler/fn.v @@ -860,7 +860,7 @@ fn (p mut Parser) fn_call_args(f mut Fn) *Fn { error_msg := ('`$typ` needs to have method `str() string` to be printable') if T.fields.len > 0 { mut index := p.cgen.cur_line.len - 1 - for index > 0 && p.cgen.cur_line[index] != ` ` { index-- } + for index > 0 && p.cgen.cur_line[index - 1] != `(` { index-- } name := p.cgen.cur_line.right(index + 1) if name == '}' { p.error(error_msg)