Fix for Module.GetMethod(string) (dotnet/coreclr#10283)
authorAtsushi Kanamori <AtsushiKan@users.noreply.github.com>
Sat, 18 Mar 2017 22:15:43 +0000 (15:15 -0700)
committerGitHub <noreply@github.com>
Sat, 18 Mar 2017 22:15:43 +0000 (15:15 -0700)
Commit migrated from https://github.com/dotnet/coreclr/commit/f22e55bf30580c4e518aaf1c94c31e79297370c6

src/coreclr/src/mscorlib/src/System/Reflection/Module.cs

index 53cd63a..0b78c9d 100644 (file)
@@ -28,7 +28,14 @@ namespace System.Reflection
         public virtual object[] GetCustomAttributes(bool inherit) { throw NotImplemented.ByDesign; }
         public virtual object[] GetCustomAttributes(Type attributeType, bool inherit) { throw NotImplemented.ByDesign; }
 
-        public MethodInfo GetMethod(string name) => GetMethod(name, null);
+        public MethodInfo GetMethod(string name)
+        {
+            if (name == null)
+                throw new ArgumentNullException(nameof(name));
+
+            return GetMethodImpl(name, Module.DefaultLookup, null, CallingConventions.Any, null, null);
+        }
+
         public MethodInfo GetMethod(string name, Type[] types) => GetMethod(name, Module.DefaultLookup, null, CallingConventions.Any, types, null);
         public MethodInfo GetMethod(string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
         {