0
0
mirror of https://github.com/vim/vim.git synced 2025-10-03 05:14:07 -04:00

patch 8.2.2621: typval2type() cannot handle recursive structures

Problem:    typval2type() cannot handle recursive structures.
Solution:   Use copyID. (closes #7979)
This commit is contained in:
Bram Moolenaar
2021-03-18 22:15:04 +01:00
parent 4b3e1964d8
commit 108cf0153c
6 changed files with 33 additions and 16 deletions

View File

@@ -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
"-------------------------------------------------------------------------------