diff src/vim9expr.c @ 31754:48431422f766 v9.0.1209

patch 9.0.1209: getting interface member does not always work Commit: https://github.com/vim/vim/commit/29ac5df37baf7e6e751c7ebd4ab37a2aa826e9e6 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jan 16 19:43:47 2023 +0000 patch 9.0.1209: getting interface member does not always work Problem: Getting interface member does not always work. Solution: Convert the index on the interface to the index on the object. (closes #11825)
author Bram Moolenaar <Bram@vim.org>
date Mon, 16 Jan 2023 20:45:04 +0100
parents 1b2bde0c64f2
children 64f03e860c91
line wrap: on
line diff
--- a/src/vim9expr.c
+++ b/src/vim9expr.c
@@ -364,6 +364,8 @@ compile_class_object_index(cctx_T *cctx,
 		}
 
 		*arg = name_end;
+		if (cl->class_flags & CLASS_INTERFACE)
+		    return generate_GET_ITF_MEMBER(cctx, cl, i, m->ocm_type);
 		return generate_GET_OBJ_MEMBER(cctx, i, m->ocm_type);
 	    }
 	}