Code Review: RubyClrInterop06


tfpt review “/shelveset:RubyClrInterop06;REDMOND\curth”
Comment :
Create constructors on generated types that match each base class
Allocator logic not yet updated to use new constructors


In DefineConstructors, newParams seems to be unnecessarily copied.
Wouldn’t it be better to do:

Type[] newParams;
Type[] baseParams = baseCtor.GetParameters();

if (has ruby class) {
newParams = baseParams;
} if (is serializer) {
newParams = baseParams;
} else {

newPrams = ArrayUtils.Insert(typeof(RubyClass), baseParams);


I would also split this method to multiple pieces, seems too big

Other than that, looks good!



Unfortunately, GetParameters() doesn’t return a type array – it returns
a ParameterInfo array. Here we see the evil of “var” – it hides the
actual type :).

I’ll look for opportunities to split the method;


Alright then :slight_smile: