comparison src/testdir/test_vim9_script.vim @ 21983:3fe594c72d8c v8.2.1541

patch 8.2.1541: Vim9: cannot find function reference for s:Func Commit: https://github.com/vim/vim/commit/95006e3dca099d3dc73d70d9872660308106e86c Author: Bram Moolenaar <Bram@vim.org> Date: Sat Aug 29 17:47:08 2020 +0200 patch 8.2.1541: Vim9: cannot find function reference for s:Func Problem: Vim9: cannot find function reference for s:Func. Solution: Recognize <SNR> prefix. (closes https://github.com/vim/vim/issues/6805)
author Bram Moolenaar <Bram@vim.org>
date Sat, 29 Aug 2020 18:00:04 +0200
parents a98211c3e14e
children 82343f008cbf
comparison
equal deleted inserted replaced
21982:8ffa48563456 21983:3fe594c72d8c
1650 1650
1651 delete('Xreload.vim') 1651 delete('Xreload.vim')
1652 delete('Ximport.vim') 1652 delete('Ximport.vim')
1653 enddef 1653 enddef
1654 1654
1655 def s:RetSome(): string
1656 return 'some'
1657 enddef
1658
1655 " Not exported function that is referenced needs to be accessed by the 1659 " Not exported function that is referenced needs to be accessed by the
1656 " script-local name. 1660 " script-local name.
1657 def Test_vim9script_funcref() 1661 def Test_vim9script_funcref()
1658 let sortlines =<< trim END 1662 let sortlines =<< trim END
1659 vim9script 1663 vim9script
1681 assert_equal([4, 3, 2, 1, 0], g:result) 1685 assert_equal([4, 3, 2, 1, 0], g:result)
1682 1686
1683 unlet g:result 1687 unlet g:result
1684 delete('Xsort.vim') 1688 delete('Xsort.vim')
1685 delete('Xscript.vim') 1689 delete('Xscript.vim')
1690
1691 let Funcref = function('s:RetSome')
1692 assert_equal('some', Funcref())
1686 enddef 1693 enddef
1687 1694
1688 " Check that when searching for "FilterFunc" it finds the import in the 1695 " Check that when searching for "FilterFunc" it finds the import in the
1689 " script where FastFilter() is called from, both as a string and as a direct 1696 " script where FastFilter() is called from, both as a string and as a direct
1690 " function reference. 1697 " function reference.