[class] Use constraints of gparam T2 in T1.IsAssignableFrom (T2)
authorAleksey Kliger <aleksey@xamarin.com>
Fri, 22 Sep 2017 14:30:44 +0000 (10:30 -0400)
committerAleksey Kliger (λgeek) <akliger@gmail.com>
Tue, 26 Sep 2017 19:59:46 +0000 (15:59 -0400)
commitfa62f916a3c02931eb6d5f72e07b9aa37b477171
treee56d6583c3c2b9527012e52c5f6e7f4c91368f2e
parent8540b4c9feb0f7b5deb333d6b7a236ca334df1d3
[class] Use constraints of gparam T2 in T1.IsAssignableFrom (T2)

Suppose we want to know C.IsAssignableFrom (T1):
```
  class C { }
  class G<T1, T2> where T1 : T2, T2 : C { }
```

Previously, we would get `False`, because we only checked the constraints of T1
if C was an interface or another gparam.  Now Instead we always consider the
constraints in `A.IsAssignableFrom (B)` whenever `B` is a gparam.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=58809
mono/metadata/class.c