capa icon indicating copy to clipboard operation
capa copied to clipboard

dotnet: how to handle calls/references to subsclasses and/or implementors of interfaces?

Open williballenthin opened this issue 2 years ago • 2 comments

within dotnet, objects of a concrete type may implement interfaces or be subclasses of more generic functionality. how should we extract method features in these cases? should we reference the concrete class? or the interface/superclass? or both?

williballenthin avatar Apr 04 '22 16:04 williballenthin

need concrete example @mike-hunhoff

williballenthin avatar Apr 04 '22 16:04 williballenthin

example:

C#:

FtpWebResponse resp = (FtpWebResponse)req.GetResponse();

IL:

IL_0000: callvirt  instance class [System]System.Net.WebResponse [System]System.Net.WebRequest::GetResponse()
IL_0005: castclass [System]System.Net.FtpWebResponse

mike-hunhoff avatar Apr 07 '22 21:04 mike-hunhoff