summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kotas <jkotas@microsoft.com>2017-10-13 13:25:47 -0700
committerJan Kotas <jkotas@microsoft.com>2017-10-13 17:14:36 -0700
commitac2a2835a4ee29dcbdb5c7e60dc3122fd00ade4c (patch)
tree3fe46cb9d37d40eec0d724c167321c30c8cb22ce
parent07d5c90436694455d3aef37007a80daffbad5667 (diff)
downloadcoreclr-ac2a2835a4ee29dcbdb5c7e60dc3122fd00ade4c.tar.gz
coreclr-ac2a2835a4ee29dcbdb5c7e60dc3122fd00ade4c.tar.bz2
coreclr-ac2a2835a4ee29dcbdb5c7e60dc3122fd00ade4c.zip
Merge pull request dotnet/corert#4719 from dotnet/nmirror
Merge nmirror to master Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
-rw-r--r--src/mscorlib/shared/System/Reflection/IntrospectionExtensions.cs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mscorlib/shared/System/Reflection/IntrospectionExtensions.cs b/src/mscorlib/shared/System/Reflection/IntrospectionExtensions.cs
index 6a18fdaa72..acf5987d44 100644
--- a/src/mscorlib/shared/System/Reflection/IntrospectionExtensions.cs
+++ b/src/mscorlib/shared/System/Reflection/IntrospectionExtensions.cs
@@ -13,7 +13,10 @@ namespace System.Reflection
if (type == null)
throw new ArgumentNullException(nameof(type));
- return ((IReflectableType)type).GetTypeInfo(); // Unguarded cast is unbecoming but kept for compatibility.
+ if (type is IReflectableType reflectableType)
+ return reflectableType.GetTypeInfo();
+
+ return new TypeDelegator(type);
}
}
}