0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

patch 8.2.3007: Vim9: test for void value fails

Problem:    Vim9: test for void value fails.
Solution:   Adjust expected error.  Do not make a copy of void.
This commit is contained in:
Bram Moolenaar 2021-06-15 22:54:28 +02:00
parent a97c36310f
commit 61a417b7c1
3 changed files with 8 additions and 4 deletions

View File

@ -86,13 +86,13 @@ func Test_empty()
endfunc
func Test_test_void()
call assert_fails('echo 1 == test_void()', 'E685:')
call assert_fails('echo 1 == test_void()', 'E1031:')
if has('float')
call assert_fails('echo 1.0 == test_void()', 'E685:')
call assert_fails('echo 1.0 == test_void()', 'E1031:')
endif
call assert_fails('let x = json_encode(test_void())', 'E685:')
call assert_fails('let x = copy(test_void())', 'E685:')
call assert_fails('let x = copy([test_void()])', 'E685:')
call assert_fails('let x = copy([test_void()])', 'E1031:')
endfunc
func Test_len()

View File

@ -591,7 +591,6 @@ copy_tv(typval_T *from, typval_T *to)
case VAR_NUMBER:
case VAR_BOOL:
case VAR_SPECIAL:
case VAR_VOID:
to->vval.v_number = from->vval.v_number;
break;
case VAR_FLOAT:
@ -664,6 +663,9 @@ copy_tv(typval_T *from, typval_T *to)
++to->vval.v_dict->dv_refcount;
}
break;
case VAR_VOID:
emsg(_(e_cannot_use_void_value));
break;
case VAR_UNKNOWN:
case VAR_ANY:
internal_error_no_abort("copy_tv(UNKNOWN)");

View File

@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
3007,
/**/
3006,
/**/