Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
24159:f2c1bf894535 | 24160:e695db9a5465 |
---|---|
6604 call assert_equal('number', typename(123)) | 6604 call assert_equal('number', typename(123)) |
6605 call assert_equal('string', typename('x')) | 6605 call assert_equal('string', typename('x')) |
6606 call assert_equal('list<number>', typename([123])) | 6606 call assert_equal('list<number>', typename([123])) |
6607 call assert_equal('dict<number>', typename(#{key: 123})) | 6607 call assert_equal('dict<number>', typename(#{key: 123})) |
6608 call assert_equal('list<dict<number>>', typename([#{key: 123}])) | 6608 call assert_equal('list<dict<number>>', typename([#{key: 123}])) |
6609 | |
6610 let l = [] | |
6611 let d = #{a: 0} | |
6612 let l = [d] | |
6613 let l[0].e = #{b: l} | |
6614 call assert_equal('list<dict<any>>', typename(l)) | |
6615 call assert_equal('dict<any>', typename(d)) | |
6609 endfunc | 6616 endfunc |
6610 | 6617 |
6611 "------------------------------------------------------------------------------- | 6618 "------------------------------------------------------------------------------- |
6612 " Test 92: skipping code {{{1 | 6619 " Test 92: skipping code {{{1 |
6613 "------------------------------------------------------------------------------- | 6620 "------------------------------------------------------------------------------- |