patch 9.1.1002: Vim9: unknown func error with interface declaring func var
Problem: Vim9: unknown function error with interface declaring a
function variable (lifepillar)
Solution: Use correct instruction for getting interface member variables
(Yegappan Lakshmanan)
fixes: #16345
closes: #16421
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/vim9expr.c b/src/vim9expr.c
index cfdea7b..9a96034 100644
--- a/src/vim9expr.c
+++ b/src/vim9expr.c
@@ -392,8 +392,15 @@
}
else
{
- if (generate_GET_OBJ_MEMBER(cctx, m_idx, ocm->ocm_type) ==
- FAIL)
+ int status;
+
+ if (IS_INTERFACE(cl))
+ status = generate_GET_ITF_MEMBER(cctx, cl, m_idx,
+ ocm->ocm_type);
+ else
+ status = generate_GET_OBJ_MEMBER(cctx, m_idx,
+ ocm->ocm_type);
+ if (status == FAIL)
return FAIL;
}
}