0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -04:00

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 #6522)
This commit is contained in:
Bram Moolenaar
2020-07-23 22:41:43 +02:00
parent 43e969d3f9
commit 40f4f7a48c
4 changed files with 17 additions and 7 deletions

View File

@@ -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'))