Skip to content

Commit

Permalink
patch 9.0.1951: Vim9: hard to debug vim9_class errors from CI
Browse files Browse the repository at this point in the history
Problem:  Vim9: hard to debug vim9_class errors from CI
Solution: Include the line number in assert_xxx() calls.  Include the
          entire error message in the tests.  Fix the indentation in the
          test file.  Add tags for new error codes.

closes: #13206

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
  • Loading branch information
yegappan authored and chrisbra committed Sep 28, 2023
1 parent 413f839 commit b90e3bc
Show file tree
Hide file tree
Showing 6 changed files with 1,512 additions and 1,510 deletions.
3 changes: 3 additions & 0 deletions runtime/doc/tags
Original file line number Diff line number Diff line change
Expand Up @@ -4479,6 +4479,9 @@ E1380 vim9class.txt /*E1380*
E1381 vim9class.txt /*E1381*
E1382 vim9class.txt /*E1382*
E1383 vim9class.txt /*E1383*
E1384 vim9class.txt /*E1384*
E1385 vim9class.txt /*E1385*
E1386 vim9class.txt /*E1386*
E1387 vim9class.txt /*E1387*
E1388 vim9class.txt /*E1388*
E1389 vim9class.txt /*E1389*
Expand Down
9 changes: 7 additions & 2 deletions runtime/doc/vim9class.txt
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,15 @@ If the class extends a parent class, the same thing happens. In the second
step the object variables of the parent class are initialized first. There is
no need to call "super()" or "new()" on the parent.

*E1365*
*E1365*
When defining the new() method the return type should not be specified. It
always returns an object of the class.

*E1386*
When invoking an object method, the method name should be preceded by the
object variable name. A object method cannot be invoked using the class
name.

==============================================================================

3. Class Variables and Methods *Vim9-class-member*
Expand All @@ -282,7 +287,7 @@ prefix in the class where they are defined: >
Since the name is used as-is, shadowing the name by a method argument name
or local variable name is not allowed.

*E1374* *E1375*
*E1374* *E1375* *E1384* *E1385*
To access a class member outside of the class where it is defined, the class
name prefix must be used. A class member cannot be accessed using an object.

Expand Down
7 changes: 5 additions & 2 deletions src/errors.h
Original file line number Diff line number Diff line change
Expand Up @@ -2396,6 +2396,7 @@ EXTERN char e_io_file_requires_name_to_be_set[]
#ifdef FEAT_EVAL
EXTERN char e_invalid_callback_argument[]
INIT(= N_("E921: Invalid callback argument"));
// E922 unused
EXTERN char e_second_argument_of_function_must_be_list_or_dict[]
INIT(= N_("E923: Second argument of function() must be a list or a dict"));
#endif
Expand Down Expand Up @@ -2790,7 +2791,7 @@ EXTERN char e_no_white_space_allowed_after_dot[]
INIT(= N_("E1074: No white space allowed after dot"));
EXTERN char e_namespace_not_supported_str[]
INIT(= N_("E1075: Namespace not supported: %s"));
// E1076 was deleted
// E1076 unused (was deleted)
EXTERN char e_missing_argument_type_for_str[]
INIT(= N_("E1077: Missing argument type for %s"));
#endif
Expand Down Expand Up @@ -2858,6 +2859,7 @@ PLURAL_MSG(e_one_argument_too_many, "E1106: One argument too many",

EXTERN char e_string_list_dict_or_blob_required[]
INIT(= N_("E1107: String, List, Dict or Blob required"));
// E1108 unused
EXTERN char e_list_item_nr_is_not_list[]
INIT(= N_("E1109: List item %d is not a List"));
EXTERN char e_list_item_nr_does_not_contain_3_numbers[]
Expand Down Expand Up @@ -3210,6 +3212,7 @@ EXTERN char e_list_dict_blob_or_string_required_for_argument_nr[]
INIT(= N_("E1251: List, Dictionary, Blob or String required for argument %d"));
EXTERN char e_string_list_or_blob_required_for_argument_nr[]
INIT(= N_("E1252: String, List or Blob required for argument %d"));
// E1253 unused
EXTERN char e_cannot_use_script_variable_in_for_loop[]
INIT(= N_("E1254: Cannot use script variable in for loop"));
#endif
Expand Down Expand Up @@ -3523,7 +3526,7 @@ EXTERN char e_class_method_str_accessible_only_using_class_str[]
INIT(= N_("E1385: Class method \"%s\" accessible only using class \"%s\""));
EXTERN char e_object_method_str_accessible_only_using_object_str[]
INIT(= N_("E1386: Object method \"%s\" accessible only using class \"%s\" object"));
EXTERN char e_public_member_not_supported_in_interface[]
EXTERN char e_public_variable_not_supported_in_interface[]
INIT(= N_("E1387: Public variable not supported in an interface"));
EXTERN char e_public_keyword_not_supported_for_method[]
INIT(= N_("E1388: Public keyword not supported for a method"));
Expand Down

2 comments on commit b90e3bc

@zeertzjq
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit is not tagged

@chrisbra
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, not sure how this happened but should be there now

Please sign in to comment.