Mercurial > vim
comparison src/testdir/test_vim9_expr.vim @ 22419:6a9e5c087c86 v8.2.1758
patch 8.2.1758: Vim9: type of unmaterialized list is wrong
Commit: https://github.com/vim/vim/commit/5597ba046790e5ffd76dfc327d7898c56df65d3f
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Sep 27 17:45:03 2020 +0200
patch 8.2.1758: Vim9: type of unmaterialized list is wrong
Problem: Vim9: type of unmaterialized list is wrong.
Solution: Use list<number>.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 27 Sep 2020 18:00:03 +0200 |
parents | 4c488004edbc |
children | 2765ae0ce02e |
comparison
equal
deleted
inserted
replaced
22418:04fb79390baf | 22419:6a9e5c087c86 |
---|---|
1515 | 1515 |
1516 let llstring: list<list<string>> = [['text'], []] | 1516 let llstring: list<list<string>> = [['text'], []] |
1517 llstring = [[], ['text']] | 1517 llstring = [[], ['text']] |
1518 llstring = [[], []] | 1518 llstring = [[], []] |
1519 | 1519 |
1520 var rangelist: list<number> = range(3) | |
1521 g:rangelist = range(3) | |
1522 CheckDefExecFailure(["var x: list<string> = g:rangelist"], 'E1012: Type mismatch; expected list<string> but got list<number>', 1) | |
1523 | |
1520 CheckDefFailure(["let x = 1234[3]"], 'E1107:', 1) | 1524 CheckDefFailure(["let x = 1234[3]"], 'E1107:', 1) |
1521 CheckDefExecFailure(["let x = g:anint[3]"], 'E1062:', 1) | 1525 CheckDefExecFailure(["let x = g:anint[3]"], 'E1062:', 1) |
1522 | 1526 |
1523 CheckDefFailure(["let x = g:list_mixed[xxx]"], 'E1001:', 1) | 1527 CheckDefFailure(["let x = g:list_mixed[xxx]"], 'E1001:', 1) |
1524 | 1528 |