mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.2.3168: Vim9: type error for constant of type any
Problem: Vim9: type error for constant of type any. Solution: Do add a runtime type check if a constant has type any. (closes #8570)
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user