RE: Should this type of method overload work in C#?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Dave Raskin <DaveRaskin@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
> Ok, here's an example of where it fails. This has an added wrinkle of another
> virtual method - Process().

<snip>

Overload resolution is done at compile time - it works out the
*signature* of which method will be called. Now, the Process method is
calling

this.service.Send(this)

and all it knows about "this" is that it's a BaseDerived - so it
doesn't know it can call Send(DerivedDerived).

--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
.



Relevant Pages

  • Re: cannot convert
    ... then I obviously can't add an OtherUser object, ... compile time) to stop AddUserList being implemented with the line I ... do given its signature - that explains why you can't pass in ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Steve Mills and top posting
    ... I don't tend to snip ... each separate point should be a new ... > And my signature is separated from the rest of the post by the standard ... keep my sig in all the following posts, helps gets hits on the website, ...
    (rec.juggling)
  • Re: initialising a vector of strings...
    ... | // for type deduction: it returns a reference to an array of N chars. ... | a compile-time constant. ... It seems to me that the signature in the declaration ...
    (alt.comp.lang.learn.c-cpp)
  • Re: ANNOUNCE: SHA-224 in Digest::SHA
    ... >> that this is the sort of functionality that ought to be controlled at ... >> compile time so that it is only implemented in situations where it is ... Brian Gladman ...
    (sci.crypt)
  • Re: Hello everyone
    ... the body of your message and your signature. ... leave in some attributions as to who posted what and snip out ... Google are evil and are ruining usenet. ...
    (uk.rec.cars.modifications)