comparison src/vim9instr.c @ 33027:669898c9a6c3 v9.0.1805

patch 9.0.1805: Vim9: problem compiling object method as function call arg Commit: https://github.com/vim/vim/commit/639751d218ef423efef8e9aa0fa9abaff7122186 Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Sun Aug 27 19:23:37 2023 +0200 patch 9.0.1805: Vim9: problem compiling object method as function call arg Problem: Vim9: problem compiling object method as function call arg Solution: After a object/class method call, remove the object/class from the stack. closes: #12081 closes: #12929 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
author Christian Brabandt <cb@256bit.org>
date Sun, 27 Aug 2023 19:30:08 +0200
parents ba1b40b520e8
children 9efd99a717c1
comparison
equal deleted inserted replaced
33026:4b7b89b356e8 33027:669898c9a6c3
1899 isn->isn_arg.ufunc.cuf_argcount = argcount; 1899 isn->isn_arg.ufunc.cuf_argcount = argcount;
1900 } 1900 }
1901 1901
1902 // drop the argument types 1902 // drop the argument types
1903 cctx->ctx_type_stack.ga_len -= argcount; 1903 cctx->ctx_type_stack.ga_len -= argcount;
1904
1905 // For an object or class method call, drop the object/class type
1906 if (ufunc->uf_class != NULL)
1907 cctx->ctx_type_stack.ga_len--;
1904 1908
1905 // add return type 1909 // add return type
1906 return push_type_stack(cctx, ufunc->uf_ret_type); 1910 return push_type_stack(cctx, ufunc->uf_ret_type);
1907 } 1911 }
1908 1912