RE: C# Override limitation..why?
- From: "Daniel Jin" <DanielJin@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 8 Jun 2005 05:18:02 -0700
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
>
>
.
- References:
- C# Override limitation..why?
- From: Cliff_Harker
- C# Override limitation..why?
- Prev by Date: Re: ActiveX User Control
- Next by Date: Re: String method that counts substrings
- Previous by thread: Re: C# Override limitation..why?
- Next by thread: Re: C# Override limitation..why?
- Index(es):
Relevant Pages
|