[reflection] Set correct reflected type in MonoMethod.get_base_method
authorAleksey Kliger <aleksey@xamarin.com>
Wed, 22 Mar 2017 19:08:59 +0000 (15:08 -0400)
committerAleksey Kliger (λgeek) <akliger@gmail.com>
Thu, 23 Mar 2017 14:31:53 +0000 (10:31 -0400)
commit8435306c98c2612fbf0898fa670c988c3a914fd9
tree60d472f7f328a27beb1037e8ecbe0e1ea581a2cf
parente461e9c6d225f9854bb451c977bfd0bc6627e05c
[reflection] Set correct reflected type in MonoMethod.get_base_method

It can be the case that we have two different System.MonoMethod objects that both
point to the same native MonoMethod* but have two different reflected types.
(For example if we call derivedType.GetMethod("f") where f is virtual and
derivedType corresponds to a class that did not override a base definition.  In
that case, the MonoMethod* corresponds to the parent type's f method, but the
reflected type is derivedType)

In this case, GetBaseDefinition will return the same MonoMethod* but the
reflected type of the result should be the base type, not the derived type.
mono/metadata/icall.c