[Ironruby-core] Problem calling explicit interface methods

Tomas Matousek Tomas.Matousek at microsoft.com
Thu Jan 8 12:48:29 EST 2009


Not yet.

obj.as(IFoo1).Bar() might be one option.

Tomas

-----Original Message-----
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Alex 2k8
Sent: Thursday, January 08, 2009 8:54 AM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] Problem calling explicit interface methods

Curious, how it is expected to work (or nobody thinked it over yet?)

Example to consider:

    - - - -
    public interface IFoo1
    {
        void Bar();
    }

    public interface IFoo2
    {
        void Bar();
    }

    public class Cls : IFoo1, IFoo2
    {
        void IFoo1.Bar() {}
        void IFoo2.Bar() {}
        public void Bar() {}
    }
    - - - -

C# approach:
    - - - -
    Cls obj = new Cls();
    obj.Bar();
    ((IFoo1)obj).Bar();
    ((IFoo2)obj).Bar();
    - - - -

What is for IronRuby?

Thanks,
 - Alex
--
Posted via http://www.ruby-forum.com/.
_______________________________________________
Ironruby-core mailing list
Ironruby-core at rubyforge.org
http://rubyforge.org/mailman/listinfo/ironruby-core



More information about the Ironruby-core mailing list