# Code Review: TypeInferenceBugs

**URL:** <https://www.ruby-forum.com/t/code-review-typeinferencebugs/183786>\
**Category:** IronRuby\
**Created:** [February 20, 2010, 2:29am UTC](https://www.ruby-forum.com/t/code-review-typeinferencebugs/183786 "2010-02-20T02:29:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![grujildo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/94ad74/32.png) [@grujildo](https://www.ruby-forum.com/u/grujildo)\
**Post date:** [February 20, 2010, 2:29am UTC](https://www.ruby-forum.com/t/code-review-typeinferencebugs/183786/1 "2010-02-20T02:29:40Z")

</div>

tfpt review “/shelveset:TypeInferenceBugs;REDMOND\tomat”  
Comment :  
Fixes bugs in type inference:

1. By-ref generic parameter  
public void Foo(ref T x);

Foo(1)  
Foo(StrongBox())

1. Multiple generic parameters  
public IEnumerable Select\<TSource,  
TResult\>(IEnumerable source, Func\<TSource, TResult\> selector);

2. Generic arrays  
public int Foo(T[] x);

3. Type shape difference  
public static int f5(Dictionary\<Dictionary\<string, T\>,  
Dictionary\<int, T\>\> arg);  
C.f5( DictionaryList[str], Dictionary[int, str] )

In general type inference seems to need more test coverage - various  
type shapes, arrays, ref/out with and w/o strong boxes, params array,  
params dict, optional, named combinations.  
I’ve added a few tests for the cases above to Ruby unit tests.

Tomas
