patch 8.2.4264: Vim9: can use old style autoload function name
Problem: Vim9: can use old style autoload function name.
Solution: Give an error for old style autoload function name.
diff --git a/src/userfunc.c b/src/userfunc.c
index d930951..f3fe493 100644
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -4232,6 +4232,11 @@
name = prefixed;
}
}
+ else if (vim9script && vim_strchr(name, AUTOLOAD_CHAR) != NULL)
+ {
+ emsg(_(e_cannot_use_name_with_hash_in_vim9_script_use_export_instead));
+ goto ret_free;
+ }
}
// An error in a function call during evaluation of an expression in magic
@@ -4540,12 +4545,6 @@
}
}
}
- else if (vim9script && vim_strchr(name, AUTOLOAD_CHAR) != NULL)
- {
- semsg(_(e_using_autoload_name_in_non_autoload_script_str),
- name);
- goto erret;
- }
}
if (var_conflict)
{