Mercurial > vim
comparison src/testdir/test_vim9_expr.vim @ 21691:f41c646cb8b9 v8.2.1395
patch 8.2.1395: Vim9: no error if declaring a funcref with lower case letter
Commit: https://github.com/vim/vim/commit/98b4f145eb89405021e23a4a37db51d60a75a1d0
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Aug 8 15:46:01 2020 +0200
patch 8.2.1395: Vim9: no error if declaring a funcref with lower case letter
Problem: Vim9: no error if declaring a funcref with a lower case letter.
Solution: Check the name after the type is inferred. Fix confusing name.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 08 Aug 2020 16:00:04 +0200 |
parents | c3f6006bf0ba |
children | 571832713efa |
comparison
equal
deleted
inserted
replaced
21690:0d43ab8ae99d | 21691:f41c646cb8b9 |
---|---|
51 let RetOne: func(string): number = function('len') | 51 let RetOne: func(string): number = function('len') |
52 let RetTwo: func(string): number = function('winnr') | 52 let RetTwo: func(string): number = function('winnr') |
53 let RetThat: func = g:atrue ? RetOne : RetTwo | 53 let RetThat: func = g:atrue ? RetOne : RetTwo |
54 assert_equal(function('len'), RetThat) | 54 assert_equal(function('len'), RetThat) |
55 | 55 |
56 let x = FuncOne | 56 let X = FuncOne |
57 let y = FuncTwo | 57 let Y = FuncTwo |
58 let Z = g:cond ? FuncOne : FuncTwo | 58 let Z = g:cond ? FuncOne : FuncTwo |
59 assert_equal(123, Z(3)) | 59 assert_equal(123, Z(3)) |
60 enddef | 60 enddef |
61 | 61 |
62 def Test_expr1_vimscript() | 62 def Test_expr1_vimscript() |
130 call CheckDefFailure(["let x = 1 ? 'one' :'two'"], msg) | 130 call CheckDefFailure(["let x = 1 ? 'one' :'two'"], msg) |
131 call CheckDefFailure(["let x = 1 ? 'one':'two'"], msg) | 131 call CheckDefFailure(["let x = 1 ? 'one':'two'"], msg) |
132 | 132 |
133 " missing argument detected even when common type is used | 133 " missing argument detected even when common type is used |
134 call CheckDefFailure([ | 134 call CheckDefFailure([ |
135 \ 'let x = FuncOne', | 135 \ 'let X = FuncOne', |
136 \ 'let y = FuncTwo', | 136 \ 'let Y = FuncTwo', |
137 \ 'let Z = g:cond ? FuncOne : FuncTwo', | 137 \ 'let Z = g:cond ? FuncOne : FuncTwo', |
138 \ 'Z()'], 'E119:') | 138 \ 'Z()'], 'E119:') |
139 endfunc | 139 endfunc |
140 | 140 |
141 " TODO: define inside test function | 141 " TODO: define inside test function |