diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-09-11 15:14:05 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-09-11 15:14:05 +0100 |
commit | 9510d22463055f56548ff461ccbc54caa1ba1a2f (patch) | |
tree | 5c084eccddd0a17e08c4bba2d5fec6d4cc969144 /src/eval.c | |
parent | cce82a55b8105560a2ef724999c856966337b48e (diff) |
patch 9.0.0444: trying to declare g:variable gives confusing errorv9.0.0444
Problem: Trying to declare g:variable gives confusing error.
Solution: Give a better error message. (closes #11108)
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/eval.c b/src/eval.c index f208ab1009..5d93b7e50c 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1031,12 +1031,16 @@ get_lval( { char_u *tp = skipwhite(p + 1); + if (is_scoped_variable(name)) + { + semsg(_(e_cannot_use_type_with_this_variable_str), name); + return NULL; + } if (tp == p + 1 && !quiet) { semsg(_(e_white_space_required_after_str_str), ":", p); return NULL; } - if (!SCRIPT_ID_VALID(current_sctx.sc_sid)) { semsg(_(e_using_type_not_in_script_context_str), p); |