summaryrefslogtreecommitdiffstats
path: root/src/vim9compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vim9compile.c')
-rw-r--r--src/vim9compile.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 4763e9550b..956ce44eb0 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -1051,7 +1051,8 @@ need_type(
// 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 && use_typecheck(actual, expected))
+ if ((!actual_is_const || actual == &t_any)
+ && use_typecheck(actual, expected))
{
generate_TYPECHECK(cctx, expected, offset, arg_idx);
return OK;