patch 9.0.1760: vim9 class problem with new() constructor
Problem: vim9 class problem with new() constructor
Solution: Don't allow a return type for the new() class constructor.
closes: #12863
closes: #12040
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
diff --git a/src/errors.h b/src/errors.h
index 67012e7..4b58cbb 100644
--- a/src/errors.h
+++ b/src/errors.h
@@ -3478,6 +3478,8 @@
#endif
EXTERN char e_warning_pointer_block_corrupted[]
INIT(= N_("E1364: Warning: Pointer block corrupted"));
+EXTERN char e_cannot_use_a_return_type_with_new[]
+ INIT(= N_("E1365: Cannot use a return type with the \"new\" function"));
EXTERN char e_cannot_mix_positional_and_non_positional_str[]
INIT(= N_("E1400: Cannot mix positional and non-positional arguments: %s"));
EXTERN char e_fmt_arg_nr_unused_str[]
@@ -3495,4 +3497,4 @@
EXTERN char e_method_str_type_mismatch_expected_str_but_got_str[]
INIT(= N_("E1407: Member \"%s\": type mismatch, expected %s but got %s"));
-// E1365 - E1399 unused
+// E1366 - E1399 unused