0
0
mirror of https://github.com/vim/vim.git synced 2025-09-30 04:44:14 -04:00

patch 8.2.0659: Vim9: no test for equal func type

Problem:    Vim9: no test for equal func type.
Solution:   Add a test.  Improve type check.
This commit is contained in:
Bram Moolenaar
2020-04-28 22:49:08 +02:00
parent affc8fd2cd
commit 939b5db480
3 changed files with 21 additions and 3 deletions

View File

@@ -30,6 +30,16 @@ def Test_expr1()
assert_equal('two', {} ? 'one' : 'two')
var = 0
assert_equal('two', var ? 'one' : 'two')
let Some: func = function('len')
let Other: func = function('winnr')
let Res: func = g:atrue ? Some : Other
assert_equal(function('len'), Res)
let RetOne: func(string): number = function('len')
let RetTwo: func(string): number = function('winnr')
let RetThat: func = g:atrue ? RetOne : RetTwo
assert_equal(function('len'), RetThat)
enddef
func Test_expr1_fails()