comparison src/testdir/test_vim9_expr.vim @ 23418:681f042ae5ac v8.2.2252

patch 8.2.2252: Vim9: crash when using lambda without return type in dict Commit: https://github.com/vim/vim/commit/6b55377303968e1624339cd95053201d5acdcaa2 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Dec 31 13:31:23 2020 +0100 patch 8.2.2252: Vim9: crash when using lambda without return type in dict Problem: Vim9: crash when using lambda without return type in dict. Solution: Without a return type use t_unknown. (closes https://github.com/vim/vim/issues/7587)
author Bram Moolenaar <Bram@vim.org>
date Thu, 31 Dec 2020 13:45:04 +0100
parents 9bd3873b13e2
children 5807e3958e38
comparison
equal deleted inserted replaced
23417:4dfa0cd43a51 23418:681f042ae5ac
2075 2075
2076 assert_equal(g:test_space_dict, {['']: 'empty', [' ']: 'space'}) 2076 assert_equal(g:test_space_dict, {['']: 'empty', [' ']: 'space'})
2077 assert_equal(g:test_hash_dict, {one: 1, two: 2}) 2077 assert_equal(g:test_hash_dict, {one: 1, two: 2})
2078 2078
2079 assert_equal({['a a']: 1, ['b/c']: 2}, {'a a': 1, "b/c": 2}) 2079 assert_equal({['a a']: 1, ['b/c']: 2}, {'a a': 1, "b/c": 2})
2080
2081 var d = {a: () => 3, b: () => 7}
2082 assert_equal(3, d.a())
2083 assert_equal(7, d.b())
2080 END 2084 END
2081 CheckDefAndScriptSuccess(lines) 2085 CheckDefAndScriptSuccess(lines)
2082 2086
2083 # legacy syntax doesn't work 2087 # legacy syntax doesn't work
2084 CheckDefFailure(["var x = #{key: 8}"], 'E1097:', 3) 2088 CheckDefFailure(["var x = #{key: 8}"], 'E1097:', 3)