On Wed, Jun 30, 2010 at 8:47 PM, Gábor Kozár <[email protected]> wrote:
> Can you explain a little bit more about this? I mean, it's just a matter of
> knowing the type. Unless you're using reflection, it should work - as I
> imagine it.

There are jillions of cases.

class Foo { public override string ToString () { return "foo"; } }
class Bar { public override string ToString () { return "Bar"; } }

static void Main ()
{
        object o = Settings.UseFoo ? new Foo () : new Bar ();
        Console.WriteLine (o.ToString ());
}

What method will be called at o.ToString (). Well it depends. And it
will be pretty much the same at each call site. Basically, all the
possibilities will tend to be the whole set of method that override
the one that is called.

-- 
Jb Evain  <[email protected]>

-- 
--
mono-cecil

Reply via email to