[Ironruby-core] Calling overloaded methods

Alex 2k8 lists at ruby-forum.com
Fri Jan 9 11:16:58 EST 2009


Hello,

C#
    public class Cls {
        public void foo(object a) {
            Console.WriteLine("foo #1");
        }
        public void foo(object[] a) {
            Console.WriteLine("foo #2");
        }
    }

Ruby:

    Cls.new.foo(7)
    Cls.new.foo([3, 4])

Output:
    foo #1
    foo #1  <-- Calling foo(object a) again


So how can I call foo(object[] a)?

- Alex
-- 
Posted via http://www.ruby-forum.com/.


More information about the Ironruby-core mailing list