mirror of
https://github.com/vim/vim.git
synced 2025-10-04 05:25:06 -04:00
patch 8.2.2146: Vim9: automatic conversion of number to string for dict key
Problem: Vim9: automatic conversion of number to string for dict key. Solution: Do not convert number to string. (closes #7474)
This commit is contained in:
@@ -1989,6 +1989,14 @@ def Test_expr7_dict()
|
||||
|
||||
CheckDefFailure(['var x = ({'], 'E723:', 2)
|
||||
CheckDefExecFailure(['{}[getftype("file")]'], 'E716: Key not present in Dictionary: ""', 1)
|
||||
|
||||
# no automatic conversion from number to string
|
||||
lines =<< trim END
|
||||
var n = 123
|
||||
var d = {[n]: 1}
|
||||
END
|
||||
CheckDefFailure(lines, 'E1012:', 2)
|
||||
CheckScriptFailure(['vim9script'] + lines, 'E928:', 3)
|
||||
enddef
|
||||
|
||||
def Test_expr7_dict_vim9script()
|
||||
|
Reference in New Issue
Block a user