Mercurial > vim
comparison src/testdir/test_vim9_func.vim @ 23531:f39a18a42aed v8.2.2308
patch 8.2.2308: Vim9: no error when assigning lambda to funcref
Commit: https://github.com/vim/vim/commit/328eac2b5d1569c57e1130ecb9f7cca733b84d78
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jan 7 19:23:08 2021 +0100
patch 8.2.2308: Vim9: no error when assigning lambda to funcref
Problem: Vim9: no error when assigning lambda to funcref without return
value.
Solution: Default return value to "any". (closes #7629)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 07 Jan 2021 19:30:06 +0100 |
parents | 27ca5534a408 |
children | 987fb6e8a376 |
comparison
equal
deleted
inserted
replaced
23530:47d509a28915 | 23531:f39a18a42aed |
---|---|
1506 CheckDefExecFailure([ | 1506 CheckDefExecFailure([ |
1507 'var Ref: func = function("NotExist")', | 1507 'var Ref: func = function("NotExist")', |
1508 'delfunc g:NotExist'], 'E700:') | 1508 'delfunc g:NotExist'], 'E700:') |
1509 enddef | 1509 enddef |
1510 | 1510 |
1511 def RefFunc(Ref: func(string): string): string | 1511 def RefFunc(Ref: func(any): any): string |
1512 return Ref('more') | 1512 return Ref('more') |
1513 enddef | 1513 enddef |
1514 | 1514 |
1515 def Test_closure_simple() | 1515 def Test_closure_simple() |
1516 var local = 'some ' | 1516 var local = 'some ' |