Move Type.cs and Module.cs to Shared Partition.
Types.cs is split into the main file, Type.Helpers.cs and Type.Enum.cs.
All three will be shared.
- GenericTypeArguments - reconcile with CoreClr
(the code is identical provided that the underlying
Type provider implemented IsConstructedGenericType
correctly. But we can't assume that for third party types.)
- IsInterface and IsSerializable has some CoreClr
specific logic for RuntimeTypes - moving this out
to the unshared space for now.
- IsContextFulImpl()/IsMarshalByRefImpl() - corrected
implemention to match CoreClr.
- IsIntegerType - no CommonRuntimeTypes in CoreClr
so going back to typeof() checks - the runtime implemented
types override all this enum code anyway on both runtimes.
- GetRootElementType() - upgraded visibility to "internal"
as a concession to CoreClr.
- CoreCLR's IsVisible has a fast path - we'll keep that.
- Moved IsRuntimeImplemented() out of Internal.Reflection.Core.NonPortable
namespace so calls to it can be more easily shared.
- Module.MethodHandle was not implemented correctly for
non-runtime modules (it's supposed to return default(ModuleHandle)).
This makes it behave correctly and reconciles Module.cs
with the CoreCLR version.
Commit migrated from https://github.com/dotnet/coreclr/commit/
b94d95ec4ed7a03ae9d9d6aaa31536211b46c8cb