patch 8.2.2777: Vim9: blob operations not tested in all ways
Problem: Vim9: blob operations not tested in all ways.
Solution: Run tests with CheckLegacyAndVim9Success(). Make blob assign with
index work.
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 801f9c1..9cb7129 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -6209,14 +6209,21 @@
}
if (dest_type == VAR_DICT && may_generate_2STRING(-1, cctx) == FAIL)
return FAIL;
- if (dest_type == VAR_LIST)
+ if (dest_type == VAR_LIST || dest_type == VAR_BLOB)
{
- if (range
- && need_type(((type_T **)stack->ga_data)[stack->ga_len - 2],
- &t_number, -1, 0, cctx, FALSE, FALSE) == FAIL)
+ type_T *type;
+
+ if (range)
+ {
+ type = ((type_T **)stack->ga_data)[stack->ga_len - 2];
+ if (need_type(type, &t_number,
+ -1, 0, cctx, FALSE, FALSE) == FAIL)
return FAIL;
- if (need_type(((type_T **)stack->ga_data)[stack->ga_len - 1],
- &t_number, -1, 0, cctx, FALSE, FALSE) == FAIL)
+ }
+ type = ((type_T **)stack->ga_data)[stack->ga_len - 1];
+ if ((dest_type != VAR_BLOB || type != &t_special)
+ && need_type(type, &t_number,
+ -1, 0, cctx, FALSE, FALSE) == FAIL)
return FAIL;
}
}