Mercurial > vim
diff src/testdir/test_vimscript.vim @ 24160:e695db9a5465 v8.2.2621
patch 8.2.2621: typval2type() cannot handle recursive structures
Commit: https://github.com/vim/vim/commit/108cf0153c5770e343aec9e2390acdaa4a0b149a
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Mar 18 22:15:04 2021 +0100
patch 8.2.2621: typval2type() cannot handle recursive structures
Problem: typval2type() cannot handle recursive structures.
Solution: Use copyID. (closes https://github.com/vim/vim/issues/7979)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 18 Mar 2021 22:30:03 +0100 |
parents | d3e064f54890 |
children | 7ffc795288dd |
line wrap: on
line diff
--- a/src/testdir/test_vimscript.vim +++ b/src/testdir/test_vimscript.vim @@ -6606,6 +6606,13 @@ func Test_typename() call assert_equal('list<number>', typename([123])) call assert_equal('dict<number>', typename(#{key: 123})) call assert_equal('list<dict<number>>', typename([#{key: 123}])) + + let l = [] + let d = #{a: 0} + let l = [d] + let l[0].e = #{b: l} + call assert_equal('list<dict<any>>', typename(l)) + call assert_equal('dict<any>', typename(d)) endfunc "-------------------------------------------------------------------------------