[Ironruby-core] Problem calling explicit interface methods

Alex 2k8 lists at ruby-forum.com
Thu Jan 8 11:53:31 EST 2009


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/.


More information about the Ironruby-core mailing list