Mercurial > vim
comparison src/testdir/test_vim9_expr.vim @ 27531:4ca0ee7b4f86 v8.2.4293
patch 8.2.4293: Vim9: when copying a list it gets type list<any>
Commit: https://github.com/vim/vim/commit/7676c158798a7c90f500cab2c12af0d47bad6026
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Feb 3 21:47:34 2022 +0000
patch 8.2.4293: Vim9: when copying a list it gets type list<any>
Problem: Vim9: when copying a list it gets type list<any> even when the
original list did not have a type.
Solution: Only set the type when the original list has a type. (closes #9692)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 03 Feb 2022 23:00:05 +0100 |
parents | 07da466dcf6d |
children | e2bb28237695 |
comparison
equal
deleted
inserted
replaced
27530:763d0c455b72 | 27531:4ca0ee7b4f86 |
---|---|
1493 endfor | 1493 endfor |
1494 assert_equal({a: 'a', 12: 12}, dany) | 1494 assert_equal({a: 'a', 12: 12}, dany) |
1495 | 1495 |
1496 # result of glob() is "any", runtime type check | 1496 # result of glob() is "any", runtime type check |
1497 var sl: list<string> = glob('*.txt', false, true) + [''] | 1497 var sl: list<string> = glob('*.txt', false, true) + [''] |
1498 | |
1499 var lln: list<list<number>> = [[1] + [2]] | |
1500 assert_equal([[1, 2]], lln) | |
1498 END | 1501 END |
1499 v9.CheckDefAndScriptSuccess(lines) | 1502 v9.CheckDefAndScriptSuccess(lines) |
1500 enddef | 1503 enddef |
1501 | 1504 |
1502 " test multiply, divide, modulo | 1505 " test multiply, divide, modulo |