diff src/vim9script.c @ 31616:0eb51cec2154 v9.0.1140

patch 9.0.1140: cannot call an object method in a compiled function Commit: https://github.com/vim/vim/commit/574950dfb1d353f094463b709e39544ebf8fcdcd Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jan 3 19:08:50 2023 +0000 patch 9.0.1140: cannot call an object method in a compiled function Problem: Cannot call an object method in a compiled function. Solution: Compile the instructins to invoke an object method.
author Bram Moolenaar <Bram@vim.org>
date Tue, 03 Jan 2023 20:15:03 +0100
parents 53c3df37a2b0
children 1009c33499e7
line wrap: on
line diff
--- a/src/vim9script.c
+++ b/src/vim9script.c
@@ -1136,7 +1136,7 @@ check_reserved_name(char_u *name, cctx_T
 		&& !(STRCMP("this", name) == 0
 		    && cctx != NULL
 		    && cctx->ctx_ufunc != NULL
-		    && (cctx->ctx_ufunc->uf_flags & FC_OBJECT)))
+		    && (cctx->ctx_ufunc->uf_flags & (FC_OBJECT|FC_NEW))))
 	{
 	    semsg(_(e_cannot_use_reserved_name_str), name);
 	    return FAIL;