mirror of
https://github.com/vim/vim.git
synced 2025-09-26 04:04:07 -04:00
patch 8.2.3168: Vim9: type error for constant of type any
Problem: Vim9: type error for constant of type any. Solution: Do add a runtime type check if a constant has type any. (closes #8570)
This commit is contained in:
@@ -1667,6 +1667,16 @@ def Test_var_type_check()
|
||||
s:d = {}
|
||||
END
|
||||
CheckScriptSuccess(lines)
|
||||
|
||||
lines =<< trim END
|
||||
vim9script
|
||||
var d = {a: 1, b: [2]}
|
||||
def Func(b: bool)
|
||||
var l: list<number> = b ? d.b : [3]
|
||||
enddef
|
||||
defcompile
|
||||
END
|
||||
CheckScriptSuccess(lines)
|
||||
enddef
|
||||
|
||||
let g:dict_number = #{one: 1, two: 2}
|
||||
|
Reference in New Issue
Block a user