summaryrefslogtreecommitdiffstats
path: root/src/vim9compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vim9compile.c')
-rw-r--r--src/vim9compile.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 634f24e1ec..6a3c32aad0 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -403,8 +403,12 @@ need_type_where(
if (ret == OK)
return OK;
+ // If actual a constant a runtime check makes no sense. If it's
+ // null_function it is OK.
+ if (actual_is_const && ret == MAYBE && actual == &t_func_unknown)
+ return OK;
+
// If the actual type can be the expected type add a runtime check.
- // If it's a constant a runtime check makes no sense.
if (!actual_is_const && ret == MAYBE && use_typecheck(actual, expected))
{
generate_TYPECHECK(cctx, expected, offset, where.wt_index);