mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-02 08:29:32 +01:00
* allow non-virtual class methods to be declared as "final" in Java classes,
since virtual class methods are handled differently from regular ones and
the JDK contains several (non-virtual, since Java does not support virtual
class methods) final class methods
git-svn-id: branches/jvmbackend@18720 -
This commit is contained in:
parent
7092f2957a
commit
e7528bbc05
@ -1374,7 +1374,9 @@ begin
|
||||
if is_objectpascal_helper(tprocdef(pd).struct) and
|
||||
(m_objfpc in current_settings.modeswitches) then
|
||||
Message1(parser_e_not_allowed_in_helper, arraytokeninfo[_FINAL].str);
|
||||
if (po_virtualmethod in pd.procoptions) then
|
||||
if (po_virtualmethod in pd.procoptions) or
|
||||
(is_javaclass(tprocdef(pd).struct) and
|
||||
(po_classmethod in pd.procoptions)) then
|
||||
include(pd.procoptions,po_finalmethod)
|
||||
else
|
||||
Message(parser_e_only_virtual_methods_final);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user