Mercurial > vim
diff src/testdir/test_vim9_script.vim @ 21473:8bcd1ee2630b v8.2.1287
patch 8.2.1287: Vim9: crash when using an imported function
Commit: https://github.com/vim/vim/commit/40f4f7a48cae491f83bd3cdbf7e9b5a23ed870ef
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jul 23 22:41:43 2020 +0200
patch 8.2.1287: Vim9: crash when using an imported function
Problem: Vim9: crash when using an imported function.
Solution: Add the function type to the imported entry. (closes https://github.com/vim/vim/issues/6522)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 23 Jul 2020 22:45:04 +0200 |
parents | 126dcb0411ed |
children | 90d859a402cc |
line wrap: on
line diff
--- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -912,6 +912,12 @@ def Test_vim9_import_export() g:imported_added = exported g:imported_func = Exported() + def GetExported(): string + let local_dict = #{ref: Exported} + return local_dict.ref() + enddef + g:funcref_result = GetExported() + import {exp_name} from './Xexport.vim' g:imported_name = exp_name exp_name ..= ' Doe' @@ -930,6 +936,7 @@ def Test_vim9_import_export() assert_equal(9879, g:imported_added) assert_equal(9879, g:imported_later) assert_equal('Exported', g:imported_func) + assert_equal('Exported', g:funcref_result) assert_equal('John', g:imported_name) assert_equal('John Doe', g:imported_name_appended) assert_false(exists('g:name'))