comparison src/vim9expr.c @ 31604:9b13b3a63bc0 v9.0.1134

patch 9.0.1134: comparing objects uses identity instead of equality Commit: https://github.com/vim/vim/commit/bcf31ec36b4b056bf06d21036640c6f0235e9c2b Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jan 2 20:32:24 2023 +0000 patch 9.0.1134: comparing objects uses identity instead of equality Problem: Comparing objects uses identity instead of equality. Solution: Compare the object values.
author Bram Moolenaar <Bram@vim.org>
date Mon, 02 Jan 2023 21:45:02 +0100
parents 53c3df37a2b0
children f3c7e573b7be
comparison
equal deleted inserted replaced
31603:2b8fe38a9989 31604:9b13b3a63bc0
271 size_t len = name_end - name; 271 size_t len = name_end - name;
272 272
273 class_T *cl = (class_T *)type->tt_member; 273 class_T *cl = (class_T *)type->tt_member;
274 if (*name_end == '(') 274 if (*name_end == '(')
275 { 275 {
276 // TODO 276 // TODO: method or function call
277 emsg("compile_class_object_index(): object/class call not handled yet");
277 } 278 }
278 else if (type->tt_type == VAR_OBJECT) 279 else if (type->tt_type == VAR_OBJECT)
279 { 280 {
280 for (int i = 0; i < cl->class_obj_member_count; ++i) 281 for (int i = 0; i < cl->class_obj_member_count; ++i)
281 { 282 {
298 semsg(_(e_member_not_found_on_object_str_str), cl->class_name, name); 299 semsg(_(e_member_not_found_on_object_str_str), cl->class_name, name);
299 } 300 }
300 else 301 else
301 { 302 {
302 // TODO: class member 303 // TODO: class member
303 emsg("compile_class_object_index(): not handled"); 304 emsg("compile_class_object_index(): class member not handled yet");
304 } 305 }
305 306
306 return FAIL; 307 return FAIL;
307 } 308 }
308 309