* give better error messages if an operator is not overloaded

git-svn-id: trunk@14575 -
This commit is contained in:
florian 2010-01-08 14:09:29 +00:00
parent ea88883915
commit d56bd6d246
4 changed files with 369 additions and 357 deletions

View File

@ -497,7 +497,7 @@ implementation
{ stop when there are no operators found }
if candidates.count=0 then
begin
CGMessage(parser_e_operator_not_overloaded);
CGMessage2(parser_e_operator_not_overloaded_2,ld.gettypename,arraytokeninfo[optoken].str);
candidates.free;
ppn.free;
t:=cnothingnode.create;
@ -515,7 +515,7 @@ implementation
{ exit when no overloads are found }
if cand_cnt=0 then
begin
CGMessage(parser_e_operator_not_overloaded);
CGMessage2(parser_e_operator_not_overloaded_2,ld.gettypename,arraytokeninfo[optoken].str);
candidates.free;
ppn.free;
t:=cnothingnode.create;
@ -661,7 +661,7 @@ implementation
{ exit when no overloads are found }
if cand_cnt=0 then
begin
CGMessage(parser_e_operator_not_overloaded);
CGMessage3(parser_e_operator_not_overloaded_3,ld.gettypename,arraytokeninfo[optoken].str,rd.gettypename);
candidates.free;
ppn.free;
t:=cnothingnode.create;

View File

@ -1280,6 +1280,12 @@ parser_e_implements_getter_not_default_cc=03281_E_Getter for implements interfac
parser_e_no_refcounted_typed_file=03282_E_Typed files cannot contain reference-counted types.
% The data in a typed file cannot be of a reference counted type (such as
% \var{ansistring} or a record containing a field that is reference counted).
parser_e_operator_not_overloaded_2=03283_E_Operator is not overloaded: $2 "$1"
% You're trying to use an overloaded operator when it is not overloaded for
% this type.
parser_e_operator_not_overloaded_3=03284_E_Operator is not overloaded: "$1" $2 "$3"
% You're trying to use an overloaded operator when it is not overloaded for
% this type.
% \end{description}
#
# Type Checking
@ -1587,7 +1593,7 @@ type_e_ordinal_or_string_expr_expected=04088_E_Ordinal or string expression expe
type_e_string_expr_expected=04089_E_String expression expected
% The expression must be a string type.
type_w_zero_to_nil=04090_W_Converting 0 to NIL
% Use NIL rather than 0 when initialising a pointer.
% Use NIL rather than 0 when initialising a pointer.
type_e_protocol_type_expected=04091_E_Objective-C protocol type expected, but got "$1"
% The compiler expected a protocol type name, but found something else.
type_e_objc_type_unsupported=04092_E_The type "$1" is not supported for interaction with the Objective-C runtime.
@ -1789,13 +1795,13 @@ sym_w_deprecated_symbol_with_msg=05066_W_Symbol "$1" is deprecated: "$2"
% should be avoided as much as possible.
sym_e_no_enumerator=05067_E_Can not find an enumerator for the type "$1"
% This means that compiler can not find an apropriate enumerator to use in the for-in loop.
% To create an enumerator you need to defind an operator enumerator or add a public or published
% To create an enumerator you need to defind an operator enumerator or add a public or published
% GetEnumerator method to the class or object definition.
sym_e_no_enumerator_move=05068_E_Can not find a "MoveNext" method in enumerator "$1"
% This means that compiler can not find a public MoveNext method with the Boolean return type in
% the enumerator class or object definition.
sym_e_no_enumerator_current=05069_E_Can not find a "Current" property in enumerator "$1"
% This means that compiler can not find a public Current property in the enumerator class or object
% This means that compiler can not find a public Current property in the enumerator class or object
% definition.
sym_e_objc_para_mismatch=05070_E_Mismatch between number of declared parameters and number of colons in message string.
% In Objective-C, a message name automatically contains as many colons as parameters.

View File

@ -370,6 +370,8 @@ const
parser_h_should_use_reintroduce_objc=03280;
parser_e_implements_getter_not_default_cc=03281;
parser_e_no_refcounted_typed_file=03282;
parser_e_operator_not_overloaded_2=03283;
parser_e_operator_not_overloaded_3=03284;
type_e_mismatch=04000;
type_e_incompatible_types=04001;
type_e_not_equal_types=04002;
@ -838,9 +840,9 @@ const
option_info=11024;
option_help_pages=11025;
MsgTxtSize = 55052;
MsgTxtSize = 55145;
MsgIdxMax : array[1..20] of longint=(
24,87,283,95,71,51,110,22,202,63,
24,87,285,95,71,51,110,22,202,63,
49,20,1,1,1,1,1,1,1,1
);

File diff suppressed because it is too large Load Diff