* allow overloads with same result type for external Java classes due to Java supporting covariant return types for interfaces

git-svn-id: trunk@45988 -
This commit is contained in:
svenbarth 2020-08-02 12:28:46 +00:00
parent 4964f5cf76
commit 848ec1d219

View File

@ -1155,7 +1155,15 @@ implementation
end;
if sameparasfound and
not (currpd.proctypeoption=potype_operator) then
not (currpd.proctypeoption=potype_operator) and
(
{ allow overloads with different result types for external java
classes as Java supports covariant return types when implementing
interfaces and e.g. AbstractStringBuilder uses that }
not assigned(currpd.struct) or
not is_java_class_or_interface(currpd.struct) or
not (oo_is_external in tobjectdef(currpd.struct).objectoptions)
) then
begin
MessagePos(currpd.fileinfo,parser_e_overloaded_have_same_parameters);
tprocsym(currpd.procsym).write_parameter_lists(currpd);