From 6586a015144f15a979d573a79d91e700e4b3009f Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 30 Sep 2022 11:04:50 +0100 Subject: patch 9.0.0627: "const" and "final" both make the type a constant Problem: "const" and "final" both make the type a constant. (Daniel Steinberg) Solution: Only have "const" make the type a constant. --- src/vim9cmds.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/vim9cmds.c') diff --git a/src/vim9cmds.c b/src/vim9cmds.c index c9c222c47..3c561d1ef 100644 --- a/src/vim9cmds.c +++ b/src/vim9cmds.c @@ -881,7 +881,7 @@ compile_for(char_u *arg_start, cctx_T *cctx) // Reserve a variable to store the loop iteration counter and initialize it // to -1. - loop_lvar = reserve_local(cctx, (char_u *)"", 0, FALSE, &t_number); + loop_lvar = reserve_local(cctx, (char_u *)"", 0, ASSIGN_VAR, &t_number); if (loop_lvar == NULL) { drop_scope(cctx); @@ -894,7 +894,7 @@ compile_for(char_u *arg_start, cctx_T *cctx) // Reserve a variable to store ec_funcrefs.ga_len, used in ISN_ENDLOOP. // The variable index is always the loop var index plus one. // It is not used when no closures are encountered, we don't know yet. - funcref_lvar = reserve_local(cctx, (char_u *)"", 0, FALSE, &t_number); + funcref_lvar = reserve_local(cctx, (char_u *)"", 0, ASSIGN_VAR, &t_number); if (funcref_lvar == NULL) { drop_scope(cctx); @@ -1050,7 +1050,8 @@ compile_for(char_u *arg_start, cctx_T *cctx) && need_type_where(item_type, lhs_type, -1, where, cctx, FALSE, FALSE) == FAIL) goto failed; - var_lvar = reserve_local(cctx, arg, varlen, TRUE, lhs_type); + var_lvar = reserve_local(cctx, arg, varlen, ASSIGN_CONST, + lhs_type); if (var_lvar == NULL) // out of memory or used as an argument goto failed; @@ -1182,7 +1183,7 @@ compile_while(char_u *arg, cctx_T *cctx) // Reserve a variable to store ec_funcrefs.ga_len, used in ISN_ENDLOOP. // It is not used when no closures are encountered, we don't know yet. - funcref_lvar = reserve_local(cctx, (char_u *)"", 0, FALSE, &t_number); + funcref_lvar = reserve_local(cctx, (char_u *)"", 0, ASSIGN_VAR, &t_number); if (funcref_lvar == NULL) { drop_scope(cctx); -- cgit v1.2.1