summaryrefslogtreecommitdiffstats
path: root/src/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/eval.c b/src/eval.c
index 0a335df071..19ab01561d 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1271,6 +1271,14 @@ get_lval(
semsg(_(e_using_type_not_in_script_context_str), p);
return NULL;
}
+ if (vim9script && (flags & GLV_NO_DECL) &&
+ !(flags & GLV_FOR_LOOP))
+ {
+ // Using a type and not in a "var" declaration.
+ semsg(_(e_trailing_characters_str), p);
+ return NULL;
+ }
+
// parse the type after the name
lp->ll_type = parse_type(&tp,