mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 10:45:08 +02:00
* never allow hiding an inherited virtual class method or virtual constructor
by a non-virtual classmethod/constructor on the JVM target, because they would also be picked up by the dynamic dispatch git-svn-id: branches/jvmbackend@18713 -
This commit is contained in:
parent
7419c97e0a
commit
18310034d7
@ -309,10 +309,14 @@ implementation
|
||||
begin
|
||||
{$ifdef jvm}
|
||||
{ if the mangled names are different, the inheritance trees
|
||||
are different too in Java }
|
||||
are different too in Java; exception: when the parent method
|
||||
is a virtual class method or virtual constructor, because
|
||||
those are looked up dynamicall by name }
|
||||
javanewtreeok:=
|
||||
is_java_class_or_interface(_class) and
|
||||
(pd.jvmmangledbasename(false)<>vmtpd.jvmmangledbasename(false));
|
||||
(pd.jvmmangledbasename(false)<>vmtpd.jvmmangledbasename(false)) and
|
||||
((vmtpd.proctypeoption<>potype_constructor) and
|
||||
not(po_staticmethod in vmtpd.procoptions));
|
||||
{$endif}
|
||||
if not(po_reintroduce in pd.procoptions) and
|
||||
not(po_java_nonvirtual in vmtpd.procoptions) then
|
||||
|
Loading…
Reference in New Issue
Block a user