diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-04-05 21:38:23 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-04-05 21:38:23 +0200 |
commit | 4c68375057c25e99656bc996d3fa5c6b0b6a7e6a (patch) | |
tree | 2be5b8f84ba889bab8caf91898092eaaba96216c /src/eval.c | |
parent | f87a0400fd81862c33d6ad2291a56e178db7dddd (diff) |
patch 8.2.0517: Vim9: cannot separate "func" and "func(): void"v8.2.0517
Problem: Vim9: cannot separate "func" and "func(): void".
Solution: Use VAR_ANY for "any" and VAR_UNKNOWN for "no type".
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/eval.c b/src/eval.c index 6d666e6121..3b789dadc6 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1272,6 +1272,7 @@ tv_op(typval_T *tv1, typval_T *tv2, char_u *op) switch (tv1->v_type) { case VAR_UNKNOWN: + case VAR_ANY: case VAR_VOID: case VAR_DICT: case VAR_FUNC: @@ -2967,6 +2968,7 @@ eval_index( emsg(_("E909: Cannot index a special variable")); return FAIL; case VAR_UNKNOWN: + case VAR_ANY: case VAR_VOID: if (evaluate) return FAIL; @@ -3073,6 +3075,7 @@ eval_index( switch (rettv->v_type) { case VAR_UNKNOWN: + case VAR_ANY: case VAR_VOID: case VAR_FUNC: case VAR_PARTIAL: @@ -3668,7 +3671,7 @@ get_lit_string_tv(char_u **arg, typval_T *rettv, int evaluate) } /* - * Return the function name of the partial. + * Return the function name of partial "pt". */ char_u * partial_name(partial_T *pt) @@ -3856,6 +3859,7 @@ tv_equal( return tv1->vval.v_string == tv2->vval.v_string; case VAR_UNKNOWN: + case VAR_ANY: case VAR_VOID: break; } @@ -4570,6 +4574,7 @@ echo_string_core( case VAR_NUMBER: case VAR_UNKNOWN: + case VAR_ANY: case VAR_VOID: *tofree = NULL; r = tv_get_string_buf(tv, numbuf); @@ -5422,6 +5427,7 @@ free_tv(typval_T *varp) #endif case VAR_NUMBER: case VAR_FLOAT: + case VAR_ANY: case VAR_UNKNOWN: case VAR_VOID: case VAR_BOOL: @@ -5486,6 +5492,7 @@ clear_tv(typval_T *varp) varp->vval.v_channel = NULL; #endif case VAR_UNKNOWN: + case VAR_ANY: case VAR_VOID: break; } @@ -5565,6 +5572,7 @@ tv_get_number_chk(typval_T *varp, int *denote) emsg(_("E974: Using a Blob as a Number")); break; case VAR_UNKNOWN: + case VAR_ANY: case VAR_VOID: internal_error_no_abort("tv_get_number(UNKNOWN)"); break; @@ -5619,6 +5627,7 @@ tv_get_float(typval_T *varp) emsg(_("E975: Using a Blob as a Float")); break; case VAR_UNKNOWN: + case VAR_ANY: case VAR_VOID: internal_error_no_abort("tv_get_float(UNKNOWN)"); break; @@ -5742,6 +5751,7 @@ tv_get_string_buf_chk(typval_T *varp, char_u *buf) #endif break; case VAR_UNKNOWN: + case VAR_ANY: case VAR_VOID: emsg(_(e_inval_string)); break; @@ -5891,6 +5901,7 @@ copy_tv(typval_T *from, typval_T *to) } break; case VAR_UNKNOWN: + case VAR_ANY: case VAR_VOID: internal_error_no_abort("copy_tv(UNKNOWN)"); break; @@ -5970,6 +5981,7 @@ item_copy( ret = FAIL; break; case VAR_UNKNOWN: + case VAR_ANY: case VAR_VOID: internal_error_no_abort("item_copy(UNKNOWN)"); ret = FAIL; |