* require that class methods are "static" for Java classes

git-svn-id: branches/jvmbackend@18345 -
This commit is contained in:
Jonas Maebe 2011-08-20 07:49:24 +00:00
parent 83dc297346
commit e269f68359
4 changed files with 303 additions and 297 deletions

View File

@ -1403,7 +1403,7 @@ parser_e_implements_no_mapping=03313_E_Interface "$1" can't have method resoluti
% \end{description}
# Type Checking
#
# 04100 is the last used one
# 04103 is the last used one
#
% \section{Type checking errors}
% This section lists all errors that can occur when type checking is
@ -1761,6 +1761,9 @@ type_e_class_helper_must_extend_subclass=04101_E_Derived class helper must exten
type_e_record_helper_must_extend_same_record=04102_E_Derived record helper must extend "$1"
% If a record helper inherits from another record helper it must extend the same
% record that the parent record helper extended.
type_e_java_class_method_not_static=04103_E_Java class methods have to be static
% All methods in Java are either regular (virtual) methods, or static class
% methods. It is not possible to declare non-static class methods.
%
% \end{description}
#

View File

@ -498,6 +498,7 @@ const
type_e_record_type_expected=04100;
type_e_class_helper_must_extend_subclass=04101;
type_e_record_helper_must_extend_same_record=04102;
type_e_java_class_method_not_static=04103;
sym_e_id_not_found=05000;
sym_f_internal_error_in_symtablestack=05001;
sym_e_duplicate_id=05002;
@ -900,9 +901,9 @@ const
option_info=11024;
option_help_pages=11025;
MsgTxtSize = 61005;
MsgTxtSize = 61050;
MsgIdxMax : array[1..20] of longint=(
26,89,314,103,85,54,111,23,202,63,
26,89,314,104,85,54,111,23,202,63,
49,20,1,1,1,1,1,1,1,1
);

File diff suppressed because it is too large Load Diff

View File

@ -706,6 +706,10 @@ implementation
if is_java_class_or_interface(pd.struct) then
begin
include(pd.procoptions,po_java);
{ In java, all methods are either regular virtual methods,
or static class methods }
if [po_staticmethod,po_classmethod]*pd.procoptions=[po_classmethod] then
messagepos(pd.fileinfo,type_e_java_class_method_not_static);
end;
end;