Move Type.cs and Module.cs to Shared Partition.
authorAtsushi Kanamori <atsushik@microsoft.com>
Mon, 20 Mar 2017 17:42:17 +0000 (10:42 -0700)
committerdotnet-bot <dotnet-bot@microsoft.com>
Mon, 20 Mar 2017 21:09:50 +0000 (21:09 +0000)
commit1ca40e79eb129b490c95c3a0bc031117b0ef81a1
treeb5b16524d27d16a922b0b366e97370df2f5e81cb
parentf1347a547817aaabf39447032a613167cb216e8d
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
src/coreclr/src/mscorlib/shared/System.Private.CoreLib.Shared.projitems
src/coreclr/src/mscorlib/shared/System/Reflection/Module.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/shared/System/Type.Enum.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/shared/System/Type.Helpers.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/shared/System/Type.cs [new file with mode: 0644]