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:
parent
a97c36310f
commit
61a417b7c1
@ -86,13 +86,13 @@ func Test_empty()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_test_void()
|
func Test_test_void()
|
||||||
call assert_fails('echo 1 == test_void()', 'E685:')
|
call assert_fails('echo 1 == test_void()', 'E1031:')
|
||||||
if has('float')
|
if has('float')
|
||||||
call assert_fails('echo 1.0 == test_void()', 'E685:')
|
call assert_fails('echo 1.0 == test_void()', 'E1031:')
|
||||||
endif
|
endif
|
||||||
call assert_fails('let x = json_encode(test_void())', 'E685:')
|
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()])', 'E685:')
|
call assert_fails('let x = copy([test_void()])', 'E1031:')
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_len()
|
func Test_len()
|
||||||
|
@ -591,7 +591,6 @@ copy_tv(typval_T *from, typval_T *to)
|
|||||||
case VAR_NUMBER:
|
case VAR_NUMBER:
|
||||||
case VAR_BOOL:
|
case VAR_BOOL:
|
||||||
case VAR_SPECIAL:
|
case VAR_SPECIAL:
|
||||||
case VAR_VOID:
|
|
||||||
to->vval.v_number = from->vval.v_number;
|
to->vval.v_number = from->vval.v_number;
|
||||||
break;
|
break;
|
||||||
case VAR_FLOAT:
|
case VAR_FLOAT:
|
||||||
@ -664,6 +663,9 @@ copy_tv(typval_T *from, typval_T *to)
|
|||||||
++to->vval.v_dict->dv_refcount;
|
++to->vval.v_dict->dv_refcount;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case VAR_VOID:
|
||||||
|
emsg(_(e_cannot_use_void_value));
|
||||||
|
break;
|
||||||
case VAR_UNKNOWN:
|
case VAR_UNKNOWN:
|
||||||
case VAR_ANY:
|
case VAR_ANY:
|
||||||
internal_error_no_abort("copy_tv(UNKNOWN)");
|
internal_error_no_abort("copy_tv(UNKNOWN)");
|
||||||
|
@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
3007,
|
||||||
/**/
|
/**/
|
||||||
3006,
|
3006,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user