1
0
forked from aniani/vim

patch 8.2.3868: Vim9: function test fails

Problem:    Vim9: function test fails.
Solution:   Add missing changes.  Add test for earlier patch.
This commit is contained in:
Bram Moolenaar
2021-12-21 13:30:42 +00:00
parent d92813a598
commit 1b5f7a6202
3 changed files with 33 additions and 12 deletions

View File

@@ -567,7 +567,9 @@ check_type_maybe(
{
// tt_type should match, except that a "partial" can be assigned to a
// variable with type "func".
// And "unknown" (using global variable) needs a runtime type check.
if (!(expected->tt_type == actual->tt_type
|| actual->tt_type == VAR_UNKNOWN
|| (expected->tt_type == VAR_FUNC
&& actual->tt_type == VAR_PARTIAL)))
{
@@ -582,7 +584,7 @@ check_type_maybe(
if (expected->tt_type == VAR_DICT || expected->tt_type == VAR_LIST)
{
// "unknown" is used for an empty list or dict
if (actual->tt_member != &t_unknown)
if (actual->tt_member != NULL && actual->tt_member != &t_unknown)
ret = check_type(expected->tt_member, actual->tt_member,
FALSE, where);
}
@@ -592,7 +594,8 @@ check_type_maybe(
// nothing, thus there is no point in checking.
if (expected->tt_member != &t_unknown)
{
if (actual->tt_member != &t_unknown)
if (actual->tt_member != NULL
&& actual->tt_member != &t_unknown)
ret = check_type(expected->tt_member, actual->tt_member,
FALSE, where);
else