Later tonight, I’m going to check in a brand new reflection layer for RubyCLR. The original code had accumulated a tremendous amount of design debt which had to be paid off. And that time is now.

There are finally a set of dedicated unit tests (>100) for the reflection layer. Previously, the reflection layer was tested indirectly from code that called into it from above. However, bugs in the older code were generally reflected via seg faults which made tracking down problems (or giving me a decent set of bug reports :) much harder than it needed to be.

The new unit tests are written in C#, and live in a new test assembly called ReflectionTests. I would greatly appreciate it if folks could sit down and think of pathological test cases that will break the layer and contribute some patches back into that test suite. Since everything in RubyCLR ultimately depends on this layer working correctly, shoring up the quality of this code will mean a quicker path to 1.0.

A warning, though. If you’ve written your own code that uses the DynamicMethod layer, lots of things have changed here to improve the rigor of the language that defines type names. I’ve decided to converge on the existing Type Name grammar that’s used in the CLR as opposed to my pseudo-C# grammar that I was using before.

For example, instead of:

List<String>::Add(String)

You’ll need to use:

Void List`1[String]::Add(String)

Notice that you need to specify the return type, and that the syntax for specifying the generic type names has changed.