Hello
There are several cases where the code tries to determine the type of elements in a enumerable type.
However, it only checks if the type is an array, or it tries to get the first generic argument. Sometimes it doesn’t even check for the possibility of an array.
This is not sufficient, as all the following are valid enumerable types. Also, the check should be done against the lowest denominator, Enumerable<T>.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
int[]asd;
List<int>asd;
classAsd:IList<int>{}
Asd asd;
classA<T>:IList<T>{}
classB:A<int>{}
Basd;
// Don't stop at the first generic type!
classA<T>:IList<T>{}
classB<U>:A<int>{}
B<QWE>asd;
// and sometimes the parameters can be non-generic too
List asd;
classAsd:IList{}
Asd asd;
I’ve added the following in ReflectionTools.cs (for lack of a better idea of where to put it)