Fix duplicate cast in RuntimeMethodInfo.GetCustomAttributes() (#20463)
authorNick Craver <nrcraver@gmail.com>
Wed, 17 Oct 2018 16:02:34 +0000 (12:02 -0400)
committerStephen Toub <stoub@microsoft.com>
Wed, 17 Oct 2018 16:02:34 +0000 (12:02 -0400)
The "as RuntimeType as RuntimeType" cast was redundant here - noticed this when digging into other issues. I couldn't trace how far back this goes due to file moves, but full framework has the same code issue.

src/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.cs

index 4591497..743d55f 100644 (file)
@@ -257,7 +257,7 @@ namespace System.Reflection
         #region ICustomAttributeProvider
         public override object[] GetCustomAttributes(bool inherit)
         {
-            return CustomAttribute.GetCustomAttributes(this, typeof(object) as RuntimeType as RuntimeType, inherit);
+            return CustomAttribute.GetCustomAttributes(this, typeof(object) as RuntimeType, inherit);
         }
 
         public override object[] GetCustomAttributes(Type attributeType, bool inherit)