From 1152bbd243db74d984752a753e1ac92ea4f60743 Mon Sep 17 00:00:00 2001 From: Maciej Michalec Date: Wed, 5 Aug 2020 16:18:28 +0200 Subject: [PATCH] repl: fix recognizing anonymous functions defs as function calls (fix #5006) (#6070) --- cmd/tools/vrepl.v | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/tools/vrepl.v b/cmd/tools/vrepl.v index 820a5a08ab..107b6c90c6 100644 --- a/cmd/tools/vrepl.v +++ b/cmd/tools/vrepl.v @@ -54,7 +54,8 @@ fn (mut r Repl) checks() bool { fn (r &Repl) function_call(line string) bool { for function in r.functions_name { - if line.starts_with(function) { + is_function_definition := line.replace(' ', '').starts_with("$function:=") + if line.starts_with(function) && !is_function_definition { return true } }