Tomas Matousek
2009-Jan-12 22:34 UTC
[Ironruby-core] Code Review: GenericMethodsAndOverloads
tfpt review "/shelveset:GenericMethodsAndOverloads;REDMOND\tomat"
Implements generic methods parameters binding and explicit overload
selection. Adds methods Method/UnboundMethod#of and
Method/UnboundMethod#overloads. Method#of takes a list of Ruby classes or CLR
types and returns a Method instance that has bound generic parameters to these
classes/types. Method#overloads takes a list of Ruby classes or CLR types and
returns a Method instance that includes only those CLR methods grouped in the
Method object whose parameters are of the given types.
Tomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GenericMethodsAndOverloads.diff
Type: application/octet-stream
Size: 37452 bytes
Desc: GenericMethodsAndOverloads.diff
URL:
<http://rubyforge.org/pipermail/ironruby-core/attachments/20090112/60c72113/attachment-0001.obj>
Curt Hagenlocher
2009-Jan-14 00:34 UTC
[Ironruby-core] Code Review: GenericMethodsAndOverloads
Changes look good overall.
In RubyMethodGroupInfo.TryBindGenericParameters, an empty set of types will
return all methods in MethodBases whether or not they''re generic.
What''s the reason for this behavior?
There''s a chunk of code that was added to Utils.cs that''s
indented too far.
-----Original Message-----
From: Tomas Matousek
Sent: Monday, January 12, 2009 2:34 PM
To: IronRuby External Code Reviewers
Cc: ironruby-core at rubyforge.org
Subject: Code Review: GenericMethodsAndOverloads
tfpt review "/shelveset:GenericMethodsAndOverloads;REDMOND\tomat"
Implements generic methods parameters binding and explicit overload
selection. Adds methods Method/UnboundMethod#of and
Method/UnboundMethod#overloads. Method#of takes a list of Ruby classes or CLR
types and returns a Method instance that has bound generic parameters to these
classes/types. Method#overloads takes a list of Ruby classes or CLR types and
returns a Method instance that includes only those CLR methods grouped in the
Method object whose parameters are of the given types.
Tomas
Tomas Matousek
2009-Jan-14 00:44 UTC
[Ironruby-core] Code Review: GenericMethodsAndOverloads
TryBindGenericParameters should look like:
foreach (var method in MethodBases) {
if (method.IsGenericMethodDefinition) {
if (typeArguments.Length ==
method.GetGenericArguments().Length) {
Debug.Assert(!(method is ConstructorInfo));
boundMethods.Add(((MethodInfo)method).MakeGenericMethod(typeArguments));
}
} else if (typeArguments.Length == 0) {
boundMethods.Add(method);
}
}
Will include this fix in Indexers2 shelveset.
Tomas
-----Original Message-----
From: Curt Hagenlocher
Sent: Tuesday, January 13, 2009 4:34 PM
To: Tomas Matousek; IronRuby External Code Reviewers
Cc: ironruby-core at rubyforge.org
Subject: RE: Code Review: GenericMethodsAndOverloads
Changes look good overall.
In RubyMethodGroupInfo.TryBindGenericParameters, an empty set of types will
return all methods in MethodBases whether or not they''re generic.
What''s the reason for this behavior?
There''s a chunk of code that was added to Utils.cs that''s
indented too far.
-----Original Message-----
From: Tomas Matousek
Sent: Monday, January 12, 2009 2:34 PM
To: IronRuby External Code Reviewers
Cc: ironruby-core at rubyforge.org
Subject: Code Review: GenericMethodsAndOverloads
tfpt review "/shelveset:GenericMethodsAndOverloads;REDMOND\tomat"
Implements generic methods parameters binding and explicit overload
selection. Adds methods Method/UnboundMethod#of and
Method/UnboundMethod#overloads. Method#of takes a list of Ruby classes or CLR
types and returns a Method instance that has bound generic parameters to these
classes/types. Method#overloads takes a list of Ruby classes or CLR types and
returns a Method instance that includes only those CLR methods grouped in the
Method object whose parameters are of the given types.
Tomas