From cb42a281773ef193277f14e7988647a4638e466c Mon Sep 17 00:00:00 2001 From: Atsushi Kanamori Date: Sat, 18 Mar 2017 15:15:43 -0700 Subject: [PATCH] Fix for Module.GetMethod(string) (dotnet/coreclr#10283) Commit migrated from https://github.com/dotnet/coreclr/commit/f22e55bf30580c4e518aaf1c94c31e79297370c6 --- src/coreclr/src/mscorlib/src/System/Reflection/Module.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/coreclr/src/mscorlib/src/System/Reflection/Module.cs b/src/coreclr/src/mscorlib/src/System/Reflection/Module.cs index 53cd63a..0b78c9d 100644 --- a/src/coreclr/src/mscorlib/src/System/Reflection/Module.cs +++ b/src/coreclr/src/mscorlib/src/System/Reflection/Module.cs @@ -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) { -- 2.7.4