[Mono-list] Base class casting weirdness

Gaurav Vaish gvaish@iitk.ac.in
Sun, 20 Jan 2002 08:12:53 +0530


----- Original Message -----
From: "Mark Hurley" <debian4tux@telocity.com>
To: "Dan Lewis" <dihlewis@yahoo.co.uk>
Cc: <mono-list@ximian.com>
Sent: Sunday, January 20, 2002 07:21
Subject: Re: [Mono-list] Base class casting weirdness


:
: What I've read and my best determination (writing can be wrong ;)) ...this
: is by DESIGN.


    Right. This feature is by design, not by any neglect or bug kinda thing.
    The idea is to be able to use the parents functionality in case you need it.
But calling something like
    F()
    where F() is defined and hierarchy is something like:

class A { ... F() ... }
class B extends A { ... F() ... }
class C extends B { ... F() ... }

    calling F() in C will lead only to recurrsion. Now consider the situation in
C# / .Net env. Calling simply F() will NOT lead to recurrsion. Calling this.F()
ONLY will lead to recurrsion. If I call F(), it refers to the top-most node
where the function has been defined and implemented and that function will be
executed ( of class A here ). To call B's F(), I will (obviously) make a call to
base.F().

    Correct me if I am wrong regarding F(), but this is what I figured out in an
experiment and analysing my deassembled code.



Cheers,
Gaurav Vaish
http://mastergaurav.virtualave.net
http://calendar.yahoo.com/mastergaurav
---------------------------------


:
: Mark Hurley
: