patch 9.0.2182: Vim9: need a way to reserve future extension
Problem: Vim9: need a way to reserve future extension
Solution: reserve double underscore prefix for future use
(Yegappan Lakshmanan)
related: #13238
closes: #13742
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/vim9class.c b/src/vim9class.c
index ec1bb86..e5d9aeb 100644
--- a/src/vim9class.c
+++ b/src/vim9class.c
@@ -1774,6 +1774,15 @@
break;
}
+ if (*p == '_' && *(p + 1) == '_')
+ {
+ // double underscore prefix for a method name is currently
+ // reserved. This could be used in the future to support
+ // object methods called by Vim builtin functions.
+ semsg(_(e_cannot_use_reserved_name_str), p);
+ break;
+ }
+
CLEAR_FIELD(ea);
ea.cmd = line;
ea.arg = p;