mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.2.1650: Vim9: result of && and || expression is not bool in script
Problem: Vim9: result of && and || expression cannot be assigned to a bool at the script level. Solution: Add the VAR_BOOL_OK flag. Convert to bool when needed.
This commit is contained in:
@@ -66,13 +66,13 @@ def Test_assignment_bool()
|
||||
let flag: bool = GetFlag()
|
||||
assert_equal(true, flag)
|
||||
flag = 0
|
||||
# assert_equal(false, flag)
|
||||
assert_equal(false, flag)
|
||||
flag = 1
|
||||
# assert_equal(true, flag)
|
||||
# flag = 99 || 123
|
||||
# assert_equal(true, flag)
|
||||
# flag = 'yes' && []
|
||||
# assert_equal(false, flag)
|
||||
assert_equal(true, flag)
|
||||
flag = 99 || 123
|
||||
assert_equal(true, flag)
|
||||
flag = 'yes' && []
|
||||
assert_equal(false, flag)
|
||||
END
|
||||
CheckScriptSuccess(lines)
|
||||
CheckDefAndScriptFailure(['let x: bool = 2'], 'E1012:')
|
||||
|
Reference in New Issue
Block a user