Patch 8.2.3007

4 views
Skip to first unread message

Bram Moolenaar

unread,
Jun 15, 2021, 4:54:57 PM6/15/21
to vim...@googlegroups.com

Patch 8.2.3007 (after 8.2.3005)
Problem: Vim9: test for void value fails.
Solution: Adjust expected error. Do not make a copy of void.
Files: src/typval.c, src/testdir/test_functions.vim


*** ../vim-8.2.3006/src/typval.c 2021-06-15 22:13:23.825621591 +0200
--- src/typval.c 2021-06-15 22:52:50.412040738 +0200
***************
*** 591,597 ****
case VAR_NUMBER:
case VAR_BOOL:
case VAR_SPECIAL:
- case VAR_VOID:
to->vval.v_number = from->vval.v_number;
break;
case VAR_FLOAT:
--- 591,596 ----
***************
*** 664,669 ****
--- 663,671 ----
++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)");
*** ../vim-8.2.3006/src/testdir/test_functions.vim 2021-06-12 12:16:51.478922236 +0200
--- src/testdir/test_functions.vim 2021-06-15 22:54:03.735885418 +0200
***************
*** 86,98 ****
endfunc

func Test_test_void()
! call assert_fails('echo 1 == test_void()', 'E685:')
if has('float')
! call assert_fails('echo 1.0 == test_void()', 'E685:')
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:')
endfunc

func Test_len()
--- 86,98 ----
endfunc

func Test_test_void()
! call assert_fails('echo 1 == test_void()', 'E1031:')
if has('float')
! 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()])', 'E1031:')
endfunc

func Test_len()
*** ../vim-8.2.3006/src/version.c 2021-06-15 22:39:07.570028096 +0200
--- src/version.c 2021-06-15 22:53:36.191944288 +0200
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 3007,
/**/

--
Engineers are always delighted to share wisdom, even in areas in which they
have no experience whatsoever. Their logic provides them with inherent
insight into any field of expertise. This can be a problem when dealing with
the illogical people who believe that knowledge can only be derived through
experience.
(Scott Adams - The Dilbert principle)

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages