tfpt review “/shelveset:TypeInferenceBugs;REDMOND\tomat”
Comment :
Fixes bugs in type inference:
- By-ref generic parameter
public void Foo(ref T x);
Foo(1)
Foo(StrongBox())
-
Multiple generic parameters
public IEnumerable Select<TSource,
TResult>(IEnumerable source, Func<TSource, TResult> selector); -
Generic arrays
public int Foo(T[] x); -
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