mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-04 18:18:32 +02:00
* only allow one "message" modifier per method declaration (mantis #14946)
git-svn-id: trunk@14001 -
This commit is contained in:
parent
ab9980967f
commit
3e624d990d
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -8752,6 +8752,7 @@ tests/webtbf/tw1483.pp svneol=native#text/plain
|
||||
tests/webtbf/tw14849.pp svneol=native#text/plain
|
||||
tests/webtbf/tw14929a.pp svneol=native#text/plain
|
||||
tests/webtbf/tw14929b.pp svneol=native#text/plain
|
||||
tests/webtbf/tw14946.pp svneol=native#text/plain
|
||||
tests/webtbf/tw1599.pp svneol=native#text/plain
|
||||
tests/webtbf/tw1599b.pp svneol=native#text/plain
|
||||
tests/webtbf/tw1633.pp svneol=native#text/plain
|
||||
|
@ -366,7 +366,7 @@ scan_w_multiple_main_name_overrides=02086_W_Overriding name of "main" procedure
|
||||
#
|
||||
# Parser
|
||||
#
|
||||
# 03257 is the last used one
|
||||
# 03258 is the last used one
|
||||
#
|
||||
% \section{Parser messages}
|
||||
% This section lists all parser messages. The parser takes care of the
|
||||
@ -1201,6 +1201,8 @@ parser_e_only_virtual_methods_final=03256_E_Only virtual methods can be final
|
||||
parser_e_final_can_no_be_overridden=03257_E_Final method can not be overridden: "$1"
|
||||
% You are trying to \var{override} a virtual method of a parent class that does
|
||||
% not exist.
|
||||
parser_e_multiple_messages=03258_E_Only one message can be used per method.
|
||||
% It is not possible to associate multiple messages with a single method.
|
||||
% \end{description}
|
||||
#
|
||||
# Type Checking
|
||||
|
@ -345,6 +345,7 @@ const
|
||||
parser_e_sealed_class_cannot_have_abstract_methods=03255;
|
||||
parser_e_only_virtual_methods_final=03256;
|
||||
parser_e_final_can_no_be_overridden=03257;
|
||||
parser_e_multiple_messages=03258;
|
||||
type_e_mismatch=04000;
|
||||
type_e_incompatible_types=04001;
|
||||
type_e_not_equal_types=04002;
|
||||
@ -800,9 +801,9 @@ const
|
||||
option_info=11024;
|
||||
option_help_pages=11025;
|
||||
|
||||
MsgTxtSize = 52086;
|
||||
MsgTxtSize = 52135;
|
||||
|
||||
MsgIdxMax : array[1..20] of longint=(
|
||||
24,87,258,91,67,50,108,22,202,62,
|
||||
24,87,259,91,67,50,108,22,202,62,
|
||||
48,20,1,1,1,1,1,1,1,1
|
||||
);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1368,6 +1368,8 @@ begin
|
||||
internalerror(2003042613);
|
||||
if not is_class(tprocdef(pd)._class) then
|
||||
Message(parser_e_msg_only_for_classes);
|
||||
if ([po_msgstr,po_msgint]*pd.procoptions)<>[] then
|
||||
Message(parser_e_multiple_messages);
|
||||
{ check parameter type }
|
||||
paracnt:=0;
|
||||
pd.parast.SymList.ForEachCall(@check_msg_para,@paracnt);
|
||||
|
17
tests/webtbf/tw14946.pp
Normal file
17
tests/webtbf/tw14946.pp
Normal file
@ -0,0 +1,17 @@
|
||||
{ %fail }
|
||||
|
||||
{$ifdef fpc}
|
||||
{$mode delphi}
|
||||
{$endif}
|
||||
|
||||
type
|
||||
ta = class
|
||||
procedure MyProc(var Msg); message 1; message 'abc';
|
||||
end;
|
||||
|
||||
procedure ta.myproc;
|
||||
begin
|
||||
end;
|
||||
|
||||
begin
|
||||
end.
|
Loading…
Reference in New Issue
Block a user