diff src/vim9expr.c @ 31590:aee868b9229a v9.0.1127

patch 9.0.1127: no error if function argument shadows class member Commit: https://github.com/vim/vim/commit/6acf757c6a11c0653b0132a17c22983856da5ad6 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jan 1 19:53:30 2023 +0000 patch 9.0.1127: no error if function argument shadows class member Problem: No error if function argument shadows class member. Solution: Give an error for shadowing a class member.
author Bram Moolenaar <Bram@vim.org>
date Sun, 01 Jan 2023 21:00:03 +0100
parents 8bbc932fbd09
children 53c3df37a2b0
line wrap: on
line diff
--- a/src/vim9expr.c
+++ b/src/vim9expr.c
@@ -603,7 +603,7 @@ compile_load(
 		else
 		    gen_load = TRUE;
 	    }
-	    else if (class_member_exists(name, &cl, &idx, cctx))
+	    else if ((idx = class_member_index(*arg, len, &cl, cctx)) >= 0)
 	    {
 		res = generate_CLASSMEMBER(cctx, TRUE, cl, idx);
 	    }