pyscripter 689 Posted September 30, 2023 (edited) As per title. For instance: A) Second method hides the first ClassA = class procedure Test(I: Integer); end; ClassB = class(classA) procedure Test(S: string); end; B) Second method overloads the first ClassA = class procedure Test(I: Integer); overload; end; ClassB = class(classA) procedure Test(S: string); overload; end; How can you tell the difference with Rtti. GetMethods would show both methods in a similar way. Edited September 30, 2023 by pyscripter Share this post Link to post
Attila Kovacs 629 Posted September 30, 2023 (edited) Yes and no. The overloaded methods will be listed one by one with the same name in getmethods but only the public ones. Edited September 30, 2023 by Attila Kovacs Share this post Link to post
pyscripter 689 Posted September 30, 2023 12 minutes ago, Attila Kovacs said: The overloaded methods will be listed one by one But so do overwritten methods, virtual methods etc. Share this post Link to post
Attila Kovacs 629 Posted September 30, 2023 hm, right. I think virtual / overriden having a DispatchKind of dkVtable and overwitten different parent. A bit of puzzle. Share this post Link to post
Stefan Glienke 2002 Posted October 4, 2023 No, RTTI does not contain any flag for a method being overloaded which makes it impossible to do proper overload resolution using RTTI because you cannot determine if a method would be "visible" or not. Share this post Link to post