mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 14:49:17 +02:00
* give an error instead of a note on the JVM target when overriding a
method by one with a lower visibility, because calling the overriding method results in a java.lang.AbstractMethodError in that case git-svn-id: trunk@21839 -
This commit is contained in:
parent
8d6557ec35
commit
c2be657671
@ -390,7 +390,7 @@ scan_w_unavailable_system_codepage=02091_W_Current system codepage "$1" is not a
|
|||||||
#
|
#
|
||||||
# Parser
|
# Parser
|
||||||
#
|
#
|
||||||
# 03321 is the last used one
|
# 03322 is the last used one
|
||||||
#
|
#
|
||||||
% \section{Parser messages}
|
% \section{Parser messages}
|
||||||
% This section lists all parser messages. The parser takes care of the
|
% This section lists all parser messages. The parser takes care of the
|
||||||
@ -1199,8 +1199,8 @@ parser_e_forward_mismatch=03249_E_Forward type definition does not match
|
|||||||
% when being implemented. A forward interface cannot be changed into a class.
|
% when being implemented. A forward interface cannot be changed into a class.
|
||||||
parser_n_ignore_lower_visibility=03250_N_Virtual method "$1" has a lower visibility ($2) than parent class $3 ($4)
|
parser_n_ignore_lower_visibility=03250_N_Virtual method "$1" has a lower visibility ($2) than parent class $3 ($4)
|
||||||
% The virtual method overrides an method that is declared with a higher visibility. This might give
|
% The virtual method overrides an method that is declared with a higher visibility. This might give
|
||||||
% unexpected results. In case the new visibility is private than it might be that a call to inherited in a
|
% unexpected results. E.g., in case the new visibility is private then a call to ``inherited'' in a
|
||||||
% new child class will call the higher visible method in a parent class and ignores the private method.
|
% new child class will call the higher-visible method in a parent class and ignores the private method.
|
||||||
parser_e_field_not_allowed_here=03251_E_Fields cannot appear after a method or property definition, start a new visibility section first
|
parser_e_field_not_allowed_here=03251_E_Fields cannot appear after a method or property definition, start a new visibility section first
|
||||||
% Once a method or property has been defined in a class or object, you cannot define any fields afterwards
|
% Once a method or property has been defined in a class or object, you cannot define any fields afterwards
|
||||||
% without starting a new visibility section (such as \var{public}, \var{private}, etc.). The reason is
|
% without starting a new visibility section (such as \var{public}, \var{private}, etc.). The reason is
|
||||||
@ -1444,6 +1444,8 @@ parser_e_jvm_invalid_virtual_constructor_call=03321_E_Calling a virtual construc
|
|||||||
% The JVM does not natively support virtual constructor. Unforunately, we are not aware of a way to
|
% The JVM does not natively support virtual constructor. Unforunately, we are not aware of a way to
|
||||||
% emulate them in a way that makes it possible to support calling virtual constructors
|
% emulate them in a way that makes it possible to support calling virtual constructors
|
||||||
% for the current instance inside another constructor.
|
% for the current instance inside another constructor.
|
||||||
|
parser_e_method_lower_visibility=03322_E_Overring method "$1" cannot have a lower visibility ($2) than in parent class $3 ($4)
|
||||||
|
% The JVM does not allow lowering the visibility of an overriding method.
|
||||||
% \end{description}
|
% \end{description}
|
||||||
# Type Checking
|
# Type Checking
|
||||||
#
|
#
|
||||||
|
@ -416,6 +416,7 @@ const
|
|||||||
parser_d_internal_parser_string=03319;
|
parser_d_internal_parser_string=03319;
|
||||||
parser_e_feature_unsupported_for_vm=03320;
|
parser_e_feature_unsupported_for_vm=03320;
|
||||||
parser_e_jvm_invalid_virtual_constructor_call=03321;
|
parser_e_jvm_invalid_virtual_constructor_call=03321;
|
||||||
|
parser_e_method_lower_visibility=03322;
|
||||||
type_e_mismatch=04000;
|
type_e_mismatch=04000;
|
||||||
type_e_incompatible_types=04001;
|
type_e_incompatible_types=04001;
|
||||||
type_e_not_equal_types=04002;
|
type_e_not_equal_types=04002;
|
||||||
@ -943,9 +944,9 @@ const
|
|||||||
option_info=11024;
|
option_info=11024;
|
||||||
option_help_pages=11025;
|
option_help_pages=11025;
|
||||||
|
|
||||||
MsgTxtSize = 65908;
|
MsgTxtSize = 66002;
|
||||||
|
|
||||||
MsgIdxMax : array[1..20] of longint=(
|
MsgIdxMax : array[1..20] of longint=(
|
||||||
26,92,322,118,87,56,116,26,202,63,
|
26,92,323,118,87,56,116,26,202,63,
|
||||||
53,20,1,1,1,1,1,1,1,1
|
53,20,1,1,1,1,1,1,1,1
|
||||||
);
|
);
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -416,7 +416,12 @@ implementation
|
|||||||
{ Give a note if the new visibility is lower. For a higher
|
{ Give a note if the new visibility is lower. For a higher
|
||||||
visibility update the vmt info }
|
visibility update the vmt info }
|
||||||
if vmtentryvis>pd.visibility then
|
if vmtentryvis>pd.visibility then
|
||||||
MessagePos4(pd.fileinfo,parser_n_ignore_lower_visibility,pd.fullprocname(false),
|
{$ifdef jvm}
|
||||||
|
MessagePos4(pd.fileinfo,parser_e_method_lower_visibility,
|
||||||
|
{$else jvm}
|
||||||
|
MessagePos4(pd.fileinfo,parser_n_ignore_lower_visibility,
|
||||||
|
{$endif jvm}
|
||||||
|
pd.fullprocname(false),
|
||||||
visibilityname[pd.visibility],tobjectdef(vmtpd.owner.defowner).objrealname^,visibilityname[vmtentryvis])
|
visibilityname[pd.visibility],tobjectdef(vmtpd.owner.defowner).objrealname^,visibilityname[vmtentryvis])
|
||||||
else if pd.visibility>vmtentryvis then
|
else if pd.visibility>vmtentryvis then
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user