RE: C# Override limitation..why?



how exactly is it a safe thing to do? consider

A a = new B();

what would the signature of a.whatever() be?

"Cliff_Harker@xxxxxxxxxxx" wrote:

> Why can't I do this in C#
>
> public class A
> {
> public A virtual whatever( A a )
> {
> }
> }
>
> public class B : A
> {
> public B override whatever( B b )
> {
> }
> }
>
> Why does the signature of the override have to match exactly the base
> version?
>
> It seems like a perfectly safe thing to do so why can't I do it? In
> some situations it saves lots of casting with duplicate methods.
>
> Cliff
>
>
.



Relevant Pages

  • Re: Operation NOT canceled by user
    ... You asked "Why are you waiting until it is safe to post again??" ... I changed my signature after I read and thought about that legalistic blurb that recently was added to the bottom of every screen on the exchange. ...
    (comp.lang.labview)
  • RE: Passwords On Paper
    ... > My number one spot for finding passwords on paper is in the safe in ... > vault in a double sealed envelope with the signature of the last person ... Instead of signature it a literal "hands-off" ...
    (Security-Basics)
  • Re: free security scan / firewall
    ... > Is it really safe? ... The pwp indicates this is a standard BY user account. ... Join the dots and ... Signature line applied for/in the post... ...
    (comp.security.unix)
  • Re: C# Override limitation..why?
    ... signature to use in all cases. ... // Explicit Interface Implementation ...
    (microsoft.public.dotnet.languages.csharp)
  • Is this OK?
    ... If I have a public class with only Public Shared functions in it, in an APS.NET web app is it ... safe (since multiple web pages, can at any time access the code within) ... Would it be safe being accessed at multiple times by ...
    (microsoft.public.dotnet.framework.aspnet)