0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.2.3296: Vim9: cannot add a number to a float

Problem:    Vim9: cannot add a number to a float.
Solution:   Accept a number if the destination is a float. (closes #8703)
This commit is contained in:
Bram Moolenaar
2021-08-05 19:01:17 +02:00
parent 4f33bc20d7
commit af647e76ca
3 changed files with 23 additions and 2 deletions

View File

@@ -245,6 +245,23 @@ def Test_assignment()
END
enddef
def Test_float_and_number()
if !has('float')
MissingFeature float
else
var lines =<< trim END
var f: float
f += 2
f -= 1
assert_equal(1.0, f)
++f
--f
assert_equal(1.0, f)
END
CheckDefAndScriptSuccess(lines)
endif
enddef
let g:someNumber = 43
def Test_assign_concat()