Mercurial > vim
comparison src/testdir/test_vim9_script.vim @ 23827:7e0d8f1cae7d v8.2.2455
patch 8.2.2455: Vim9: key type for literal dict and indexing is inconsistent
Commit: https://github.com/vim/vim/commit/2e5910bfbb05957c10c9c69756dfa342557e9a8b
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Feb 3 17:41:24 2021 +0100
patch 8.2.2455: Vim9: key type for literal dict and indexing is inconsistent
Problem: Vim9: key type that can be used for literal dict and indexing is
inconsistent.
Solution: Allow using number and bool as key for a literal dict. (#7771)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 03 Feb 2021 17:45:06 +0100 |
parents | e2ebd45d4db0 |
children | a4df35126d9c |
comparison
equal
deleted
inserted
replaced
23826:71d7c2500ee3 | 23827:7e0d8f1cae7d |
---|---|
448 endtry | 448 endtry |
449 assert_equal(255, n) | 449 assert_equal(255, n) |
450 | 450 |
451 var nd: dict<any> | 451 var nd: dict<any> |
452 try | 452 try |
453 nd = {[g:anumber]: 1} | 453 nd = {[g:alist]: 1} |
454 catch /E1012:/ | 454 catch /E1105:/ |
455 n = 266 | 455 n = 266 |
456 endtry | 456 endtry |
457 assert_equal(266, n) | 457 assert_equal(266, n) |
458 | 458 |
459 try | 459 try |