diff src/vim9compile.c @ 32475:a44d7e4ac1c0 v9.0.1569

patch 9.0.1569: cannot use "this.member" in lambda in class method Commit: https://github.com/vim/vim/commit/2bd6a09691fc71974ca7ab5973f8e08fdd2a889a Author: h-east <h.east.727@gmail.com> Date: Fri May 19 19:01:17 2023 +0100 patch 9.0.1569: cannot use "this.member" in lambda in class method Problem: Cannot use "this.member" in lambda in class method. Solution: Adjust check for reserved keyword. (Hirohito Higashi, closes #12416, closes #12076, closes #12336)
author Bram Moolenaar <Bram@vim.org>
date Fri, 19 May 2023 20:15:04 +0200
parents db97ccaaa7c8
children 448aef880252
line wrap: on
line diff
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -1580,7 +1580,8 @@ compile_lhs(
 	else
 	{
 	    // No specific kind of variable recognized, just a name.
-	    if (check_reserved_name(lhs->lhs_name, cctx) == FAIL)
+	    if (check_reserved_name(lhs->lhs_name, lhs->lhs_has_index
+						&& *var_end == '.') == FAIL)
 		return FAIL;
 
 	    if (lookup_local(var_start, lhs->lhs_varlen,