diff --git a/src/Ramstack.ExpressionParser/ExpressionBuilder.cs b/src/Ramstack.ExpressionParser/ExpressionBuilder.cs index c7fb7fc..ec6caf0 100644 --- a/src/Ramstack.ExpressionParser/ExpressionBuilder.cs +++ b/src/Ramstack.ExpressionParser/ExpressionBuilder.cs @@ -14,12 +14,11 @@ public partial class ExpressionBuilder(Binder binder) : ExprVisitor /// /// The overloads of the string.Concat method that the + operator with a string operand is bound to. /// - private static readonly MethodBase[] s_concatMethods = typeof(string) + private static readonly MethodInfo[] s_concatMethods = typeof(string) .GetMethods(BindingFlags.Public | BindingFlags.Static) .Where(m => m.Name == nameof(string.Concat) && (m.CallingConvention & CallingConventions.VarArgs) == 0) - .Cast() .ToArray(); /// @@ -239,7 +238,7 @@ Expression ProcessIndex() if (methods.Count == 0) Error.NonIndexingType(self.Type); - var method = (MethodInfo?)MethodResolver.ResolveMethod(methods.ToArray(), parameterTypes); + var method = (MethodInfo?)MethodResolver.ResolveMethod(methods, parameterTypes); if (method is null) Error.AmbiguousMatch(indexers);