Merge pull request #2714 from lambdageek/dev/monoerror-mono_reflection_type_get_handle
authormonojenkins <jo.shields+jenkins@xamarin.com>
Fri, 4 Mar 2016 22:00:19 +0000 (22:00 +0000)
committermonojenkins <jo.shields+jenkins@xamarin.com>
Fri, 4 Mar 2016 22:00:19 +0000 (22:00 +0000)
commit7c7729117b7b280fdba085a56ef400e2e9e35420
treec6342393025f3a04429b026b91910192e551f2df
parentbed9bc56d829a49b9f30d229f248233e73badb17
parent20a111a215c2ad93ab77068d2e81e21c886b9846
Merge pull request #2714 from lambdageek/dev/monoerror-mono_reflection_type_get_handle

[reflection] MonoError for mono_reflection_type_get_handle

`mono_reflection_type_get_handle` is really a kind of normalization procedure that synthesizes real `MonoType`s from reflection's derived types such as `System.Reflection.Emit.ArrayType, ByRefType`, etc.  So we call it all over the place in System.Reflection.Emit runtime code.

That would all be fine, except that users are allowed to subclass `System.Type`, so we have to call the `UnderlyingSystemType()` method to get a real type.  Which means that an override can throw.  Which in coop mode means we have to thread around a `MonoError`.  So that's why this code is uglier.

But really this code is doing a lot of type inspection and high-level work that we should figure out how to migrate to managed.
mono/metadata/object-internals.h