John Lam 1997 — 2026

Method Overload Resolution

The current method overload algorithm in the RubyCLR bridge is a placeholder. It only works for very simple cases (which, granted easily account for 80+% of the cases). It doesn’t handle corner cases very well, nor does it handle parameter arrays (although there is some code there to handle those cases, it’s just not called right now). The algorithm is also fairly poor both in terms of space and in time. So there’s quite a lot of room for improvement there.

In this next iteration, I’m planning on tackling the generics overloading problem, which requires me to think very carefully about the algorithm.

Before tackling generics, I decided to spend some time writing test cases for non-generic corner cases, as well as cleaning up a bunch of missing bits in the code. Rather than reinventing the wheel, I decided to take a look at the test cases for IronPython, since I figure that they would have a similar set of problems to deal with.

I found a very clever set of test cases in BindingTest.py. As I ported them to Ruby, I discovered a number of missing features in my existing codebase (such as marshaling Booleans as parameters – I was missing an entry in a hashtable). I’ve spent part of the day fixing those bugs and writing a new set of unit tests in preparation for a rewrite of the method overload algorithm.

One thing that I discovered while looking at the Python unit tests is that I’m going to have to tackle enumerations sooner rather than later. Once I have support for enumerations in RubyCLR, I’ll ship a new drop, likely by the end of the week.