Problem: Vim9: type error when function return type is not known yet.
Solution: When return type is unknown, use "any". (closes #8644)
var F: func = function('min', [[5, 8, 6]])
F->get('name')->assert_equal('min')
F->get('args')->assert_equal([[5, 8, 6]])
+
+ var lines =<< trim END
+ vim9script
+ def DoThat(): number
+ var Getqflist: func = function('getqflist', [{id: 42}])
+ return Getqflist()->get('id', 77)
+ enddef
+ assert_equal(0, DoThat())
+ END
+ CheckScriptSuccess(lines)
enddef
def Test_getbufinfo()
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 3230,
/**/
3229,
/**/
}
}
ret_type = type->tt_member;
+ if (ret_type == &t_unknown)
+ // return type not known yet, use a runtime check
+ ret_type = &t_any;
}
else
{