Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Algorithmen, Datenstrukturen und Klassendesign (https://www.delphipraxis.net/78-algorithmen-datenstrukturen-und-klassendesign/)
-   -   Verständins Compiler error : Identical function names (https://www.delphipraxis.net/214186-verstaendins-compiler-error-identical-function-names.html)

bernhard_LA 30. Nov 2023 13:00

Verständins Compiler error : Identical function names
 
mein Code sieht vereinfacht so aus:


Delphi-Quellcode:
Unit A;

....
function saveasCSV ( aClass : TClassA; filename : String); overload;
function saveasCSV ( aClass : TClassB; filename : String); overload;
function saveasCSV ( aClass : TClassC; filename : String); overload;

implementation
....


end;

in einer weiteren Unit:

Delphi-Quellcode:
Unit OtherClass ;



   TOtherCLass = class

       function dothis;
       function dothat;
       function saveasCSV ( filename : String);

end;



Delphi-Quellcode:

unit ProblemCode;

uses OtherClass, A, ....;


    var MyClass : TClassA

    if (...) then
        saveasCSV ( MyClass , filename) ;


[dcc64 Error] Unit_demo.pas(696): E2010 Incompatible types: '...' and '....'
Warum will denn der Compiler die Funktion aus meiner otherclass unit verwenden und nicht die in einer unit frei global definierte Funktion?

jaenicke 30. Nov 2023 13:09

AW: Verständins Compiler error : Identical function names
 
Bist du sicher, dass du weder in einer abgeleiteten Klasse von TOtherCLass bist noch innerhalb eines with-Blocks?


Alle Zeitangaben in WEZ +1. Es ist jetzt 06:06 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz