comparison src/vim9expr.c @ 31694:2f61e308b997 v9.0.1179

patch 9.0.1179: not all errors around inheritance are tested Commit: https://github.com/vim/vim/commit/6aa0937fb88001a5ea18e732aad4c625e9b2baeb Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jan 11 17:59:38 2023 +0000 patch 9.0.1179: not all errors around inheritance are tested Problem: Not all errors around inheritance are tested. Solution: Add more tests. Fix uncovered problems.
author Bram Moolenaar <Bram@vim.org>
date Wed, 11 Jan 2023 19:00:06 +0100
parents 2f1af1b2f82d
children 1b2bde0c64f2
comparison
equal deleted inserted replaced
31693:2698d61dcc97 31694:2f61e308b997
266 class_T *cl = (class_T *)type->tt_member; 266 class_T *cl = (class_T *)type->tt_member;
267 int is_super = type->tt_flags & TTFLAG_SUPER; 267 int is_super = type->tt_flags & TTFLAG_SUPER;
268 if (type == &t_super) 268 if (type == &t_super)
269 { 269 {
270 if (cctx->ctx_ufunc == NULL || cctx->ctx_ufunc->uf_class == NULL) 270 if (cctx->ctx_ufunc == NULL || cctx->ctx_ufunc->uf_class == NULL)
271 {
271 emsg(_(e_using_super_not_in_class_function)); 272 emsg(_(e_using_super_not_in_class_function));
272 else 273 return FAIL;
273 { 274 }
274 is_super = TRUE; 275 is_super = TRUE;
275 cl = cctx->ctx_ufunc->uf_class; 276 cl = cctx->ctx_ufunc->uf_class;
276 // Remove &t_super from the stack. 277 // Remove &t_super from the stack.
277 --cctx->ctx_type_stack.ga_len; 278 --cctx->ctx_type_stack.ga_len;
278 }
279 } 279 }
280 else if (type->tt_type == VAR_CLASS) 280 else if (type->tt_type == VAR_CLASS)
281 { 281 {
282 garray_T *instr = &cctx->ctx_instr; 282 garray_T *instr = &cctx->ctx_instr;
283 if (instr->ga_len > 0) 283 if (instr->ga_len > 0)
2259 // class member: SomeClass.varname 2259 // class member: SomeClass.varname
2260 // class method: SomeClass.SomeMethod() 2260 // class method: SomeClass.SomeMethod()
2261 // class constructor: SomeClass.new() 2261 // class constructor: SomeClass.new()
2262 // object member: someObject.varname, this.varname 2262 // object member: someObject.varname, this.varname
2263 // object method: someObject.SomeMethod(), this.SomeMethod() 2263 // object method: someObject.SomeMethod(), this.SomeMethod()
2264 *arg = p;
2264 if (compile_class_object_index(cctx, arg, type) == FAIL) 2265 if (compile_class_object_index(cctx, arg, type) == FAIL)
2265 return FAIL; 2266 return FAIL;
2266 } 2267 }
2267 else if (*p == '.' && p[1] != '.') 2268 else if (*p == '.' && p[1] != '.')
2268 { 2269 {