repl: fix recognizing anonymous functions defs as function calls (fix #5006) (#6070)

pull/6074/head
Maciej Michalec 2020-08-05 16:18:28 +02:00 committed by GitHub
parent ecaccafd31
commit 1152bbd243
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -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
}
}