From 345eb6d250e187590cebf90d812d30ddec8cf5ef Mon Sep 17 00:00:00 2001 From: Ilya Date: Sat, 2 Mar 2019 21:57:19 +0500 Subject: [PATCH 01/23] Step 1 --- .../engine/parser/Compiler.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/System.Management.Automation/engine/parser/Compiler.cs b/src/System.Management.Automation/engine/parser/Compiler.cs index 974fc59b6d3..75e91ba30f7 100644 --- a/src/System.Management.Automation/engine/parser/Compiler.cs +++ b/src/System.Management.Automation/engine/parser/Compiler.cs @@ -38,15 +38,15 @@ internal static class CachedReflectionInfo typeof(List).GetMethod(nameof(List.ToArray), PSTypeExtensions.EmptyTypes); internal static readonly MethodInfo ArrayOps_GetMDArrayValue = - typeof(ArrayOps).GetMethod(nameof(ArrayOps.GetMDArrayValue), staticFlags); + typeof(ArrayOps).GetMethod(nameof(ArrayOps.GetMDArrayValue), staticFlags, null, new Type[] { typeof(Array), typeof(int[]), typeof(bool) }, null); internal static readonly MethodInfo ArrayOps_GetMDArrayValueOrSlice = - typeof(ArrayOps).GetMethod(nameof(ArrayOps.GetMDArrayValueOrSlice), staticFlags); + typeof(ArrayOps).GetMethod(nameof(ArrayOps.GetMDArrayValueOrSlice), staticFlags, null, new Type[] { typeof(Array), typeof(object) }, null); internal static readonly MethodInfo ArrayOps_GetNonIndexable = - typeof(ArrayOps).GetMethod(nameof(ArrayOps.GetNonIndexable), staticFlags); + typeof(ArrayOps).GetMethod(nameof(ArrayOps.GetNonIndexable), staticFlags, null, new Type[] { typeof(object), typeof(object[]) }, null); internal static readonly MethodInfo ArrayOps_IndexStringMessage = - typeof(ArrayOps).GetMethod(nameof(ArrayOps.IndexStringMessage), staticFlags); + typeof(ArrayOps).GetMethod(nameof(ArrayOps.IndexStringMessage), staticFlags, null, new Type[] { typeof(object) }, null); internal static readonly MethodInfo ArrayOps_Multiply = - typeof(ArrayOps).GetMethod(nameof(ArrayOps.Multiply), staticFlags); + typeof(ArrayOps).GetMethod(nameof(ArrayOps.Multiply), genericParameterCount: 1, staticFlags, null, new Type[] { Type.MakeGenericMethodParameter(0).MakeArrayType(), typeof(uint) }, null); internal static readonly MethodInfo ArrayOps_SetMDArrayValue = typeof(ArrayOps).GetMethod(nameof(ArrayOps.SetMDArrayValue), staticFlags); internal static readonly MethodInfo ArrayOps_SlicingIndex = From b2f7b0ea382dd338ed2250c8fcccee39a1a0da6e Mon Sep 17 00:00:00 2001 From: Ilya Date: Sat, 2 Mar 2019 22:32:51 +0500 Subject: [PATCH 02/23] Step 2 --- .../engine/parser/Compiler.cs | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/System.Management.Automation/engine/parser/Compiler.cs b/src/System.Management.Automation/engine/parser/Compiler.cs index 75e91ba30f7..e3cebc0d866 100644 --- a/src/System.Management.Automation/engine/parser/Compiler.cs +++ b/src/System.Management.Automation/engine/parser/Compiler.cs @@ -48,22 +48,21 @@ internal static class CachedReflectionInfo internal static readonly MethodInfo ArrayOps_Multiply = typeof(ArrayOps).GetMethod(nameof(ArrayOps.Multiply), genericParameterCount: 1, staticFlags, null, new Type[] { Type.MakeGenericMethodParameter(0).MakeArrayType(), typeof(uint) }, null); internal static readonly MethodInfo ArrayOps_SetMDArrayValue = - typeof(ArrayOps).GetMethod(nameof(ArrayOps.SetMDArrayValue), staticFlags); + typeof(ArrayOps).GetMethod(nameof(ArrayOps.SetMDArrayValue), staticFlags, null, new Type[] { typeof(Array), typeof(int[]), typeof(object) }, null); internal static readonly MethodInfo ArrayOps_SlicingIndex = - typeof(ArrayOps).GetMethod(nameof(ArrayOps.SlicingIndex), staticFlags); + typeof(ArrayOps).GetMethod(nameof(ArrayOps.SlicingIndex), staticFlags, null, new Type[] { typeof(object), typeof(object[]), typeof(Func) }, null); internal static readonly ConstructorInfo BreakException_ctor = - typeof(BreakException).GetConstructor(instanceFlags, null, CallingConventions.Standard, - new Type[] { typeof(string) }, null); + typeof(BreakException).GetConstructor(instanceFlags, null, CallingConventions.Standard, new Type[] { typeof(string) }, null); internal static readonly MethodInfo CharOps_CompareIeq = - typeof(CharOps).GetMethod(nameof(CharOps.CompareIeq), staticFlags); + typeof(CharOps).GetMethod(nameof(CharOps.CompareIeq), staticFlags, null, new Type[] { typeof(char), typeof(char) }, null); internal static readonly MethodInfo CharOps_CompareIne = - typeof(CharOps).GetMethod(nameof(CharOps.CompareIne), staticFlags); + typeof(CharOps).GetMethod(nameof(CharOps.CompareIne), staticFlags, null, new Type[] { typeof(char), typeof(char) }, null); internal static readonly MethodInfo CharOps_CompareStringIeq = - typeof(CharOps).GetMethod(nameof(CharOps.CompareStringIeq), staticFlags); + typeof(CharOps).GetMethod(nameof(CharOps.CompareStringIeq), staticFlags, null, new Type[] { typeof(char), typeof(string) }, null); internal static readonly MethodInfo CharOps_CompareStringIne = - typeof(CharOps).GetMethod(nameof(CharOps.CompareStringIne), staticFlags); + typeof(CharOps).GetMethod(nameof(CharOps.CompareStringIne), staticFlags, null, new Type[] { typeof(char), typeof(string) }, null); internal static readonly MethodInfo CommandParameterInternal_CreateArgument = typeof(CommandParameterInternal).GetMethod(nameof(CommandParameterInternal.CreateArgument), staticFlags); internal static readonly MethodInfo CommandParameterInternal_CreateParameter = @@ -75,25 +74,24 @@ internal static class CachedReflectionInfo typeof(CommandRedirection).GetMethod(nameof(CommandRedirection.UnbindForExpression), instanceFlags); internal static readonly ConstructorInfo ContinueException_ctor = - typeof(ContinueException).GetConstructor(instanceFlags, null, CallingConventions.Standard, - new Type[] { typeof(string) }, null); + typeof(ContinueException).GetConstructor(instanceFlags, null, CallingConventions.Standard, new Type[] { typeof(string) }, null); internal static readonly MethodInfo Convert_ChangeType = typeof(Convert).GetMethod(nameof(Convert.ChangeType), new Type[] { typeof(object), typeof(Type) }); internal static readonly MethodInfo Debugger_EnterScriptFunction = - typeof(ScriptDebugger).GetMethod(nameof(ScriptDebugger.EnterScriptFunction), instanceFlags); + typeof(ScriptDebugger).GetMethod(nameof(ScriptDebugger.EnterScriptFunction), instanceFlags, null, new Type[] { typeof(FunctionContext) }, null); internal static readonly MethodInfo Debugger_ExitScriptFunction = - typeof(ScriptDebugger).GetMethod(nameof(ScriptDebugger.ExitScriptFunction), instanceFlags); + typeof(ScriptDebugger).GetMethod(nameof(ScriptDebugger.ExitScriptFunction), instanceFlags, null, Type.EmptyTypes, null); internal static readonly MethodInfo Debugger_OnSequencePointHit = - typeof(ScriptDebugger).GetMethod(nameof(ScriptDebugger.OnSequencePointHit), instanceFlags); + typeof(ScriptDebugger).GetMethod(nameof(ScriptDebugger.OnSequencePointHit), instanceFlags, null, new Type[] { typeof(FunctionContext) }, null); internal static readonly MethodInfo EnumerableOps_AddEnumerable = - typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.AddEnumerable), staticFlags); + typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.AddEnumerable), staticFlags, null, new Type[] { typeof(ExecutionContext), typeof(IEnumerator), typeof(IEnumerator) }, null); internal static readonly MethodInfo EnumerableOps_AddObject = - typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.AddObject), staticFlags); + typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.AddObject), staticFlags, null, new Type[] { typeof(ExecutionContext), typeof(IEnumerator), typeof(object) }, null); internal static readonly MethodInfo EnumerableOps_Compare = - typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.Compare), staticFlags); + typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.Compare), staticFlags, null, new Type[] { typeof(IEnumerator), typeof(object), typeof(Func) }, null); internal static readonly MethodInfo EnumerableOps_GetEnumerator = typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.GetEnumerator), staticFlags); internal static readonly MethodInfo EnumerableOps_GetCOMEnumerator = From 9893dd4969e781f700772ce82b57af83a3c4fdb2 Mon Sep 17 00:00:00 2001 From: Ilya Date: Sat, 2 Mar 2019 22:59:48 +0500 Subject: [PATCH 03/23] Step 3 --- .../engine/parser/Compiler.cs | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/System.Management.Automation/engine/parser/Compiler.cs b/src/System.Management.Automation/engine/parser/Compiler.cs index e3cebc0d866..9a9c8a7dc56 100644 --- a/src/System.Management.Automation/engine/parser/Compiler.cs +++ b/src/System.Management.Automation/engine/parser/Compiler.cs @@ -93,33 +93,32 @@ internal static class CachedReflectionInfo internal static readonly MethodInfo EnumerableOps_Compare = typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.Compare), staticFlags, null, new Type[] { typeof(IEnumerator), typeof(object), typeof(Func) }, null); internal static readonly MethodInfo EnumerableOps_GetEnumerator = - typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.GetEnumerator), staticFlags); + typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.GetEnumerator), staticFlags, null, new Type[] { typeof(IEnumerable) }, null); internal static readonly MethodInfo EnumerableOps_GetCOMEnumerator = - typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.GetCOMEnumerator), staticFlags); + typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.GetCOMEnumerator), staticFlags, null, new Type[] { typeof(object) }, null); internal static readonly MethodInfo EnumerableOps_GetGenericEnumerator = typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.GetGenericEnumerator), staticFlags); internal static readonly MethodInfo EnumerableOps_GetSlice = - typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.GetSlice), staticFlags); + typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.GetSlice), staticFlags, null, new Type[] { typeof(IList), typeof(int) }, null); internal static readonly MethodInfo EnumerableOps_MethodInvoker = - typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.MethodInvoker), staticFlags); + typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.MethodInvoker), staticFlags, null, new Type[] { typeof(PSInvokeMemberBinder), typeof(Type), typeof(IEnumerator), typeof(object[]), typeof(Type) }, null); internal static readonly MethodInfo EnumerableOps_Where = - typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.Where), staticFlags); + typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.Where), staticFlags, null, new Type[] { typeof(IEnumerator), typeof(ScriptBlock), typeof(WhereOperatorSelectionMode), typeof(int) }, null); internal static readonly MethodInfo EnumerableOps_ForEach = - typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.ForEach), staticFlags); + typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.ForEach), staticFlags, null, new Type[] { typeof(IEnumerator), typeof(object), typeof(object[]) }, null); internal static readonly MethodInfo EnumerableOps_Multiply = - typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.Multiply), staticFlags); + typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.Multiply), staticFlags, null, new Type[] { typeof(IEnumerator), typeof(uint) }, null); internal static readonly MethodInfo EnumerableOps_PropertyGetter = - typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.PropertyGetter), staticFlags); + typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.PropertyGetter), staticFlags, null, new Type[] { typeof(PSGetMemberBinder), typeof(IEnumerator) }, null); internal static readonly MethodInfo EnumerableOps_SlicingIndex = - typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.SlicingIndex), staticFlags); + typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.SlicingIndex), staticFlags, null, new Type[] { typeof(object), typeof(IEnumerator), typeof(Func) }, null); internal static readonly MethodInfo EnumerableOps_ToArray = - typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.ToArray), staticFlags); + typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.ToArray), staticFlags, null, new Type[] { typeof(IEnumerator) }, null); internal static readonly MethodInfo EnumerableOps_WriteEnumerableToPipe = - typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.WriteEnumerableToPipe), staticFlags); + typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.WriteEnumerableToPipe), staticFlags, null, new Type[] { typeof(IEnumerator), typeof(Pipe), typeof(ExecutionContext), typeof(bool) }, null); internal static readonly ConstructorInfo ErrorRecord__ctor = - typeof(ErrorRecord).GetConstructor(instanceFlags | BindingFlags.Public, null, CallingConventions.Standard, - new Type[] { typeof(ErrorRecord), typeof(RuntimeException) }, null); + typeof(ErrorRecord).GetConstructor(instanceFlags | BindingFlags.Public, null, CallingConventions.Standard, new Type[] { typeof(ErrorRecord), typeof(RuntimeException) }, null); internal static readonly PropertyInfo Exception_Message = typeof(Exception).GetProperty(nameof(Exception.Message)); From 53c3a93bd990fd63bc610df67d2c5569c12b225d Mon Sep 17 00:00:00 2001 From: Ilya Date: Sat, 2 Mar 2019 23:26:16 +0500 Subject: [PATCH 04/23] Step 4 --- .../engine/parser/Compiler.cs | 38 +++++++++---------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/src/System.Management.Automation/engine/parser/Compiler.cs b/src/System.Management.Automation/engine/parser/Compiler.cs index 9a9c8a7dc56..d65404daaf6 100644 --- a/src/System.Management.Automation/engine/parser/Compiler.cs +++ b/src/System.Management.Automation/engine/parser/Compiler.cs @@ -124,19 +124,19 @@ internal static class CachedReflectionInfo typeof(Exception).GetProperty(nameof(Exception.Message)); internal static readonly MethodInfo ExceptionHandlingOps_CheckActionPreference = - typeof(ExceptionHandlingOps).GetMethod(nameof(ExceptionHandlingOps.CheckActionPreference), staticFlags); + typeof(ExceptionHandlingOps).GetMethod(nameof(ExceptionHandlingOps.CheckActionPreference), staticFlags, null, new Type[] { typeof(FunctionContext), typeof(Exception) }, null); internal static readonly MethodInfo ExceptionHandlingOps_ConvertToArgumentConversionException = - typeof(ExceptionHandlingOps).GetMethod(nameof(ExceptionHandlingOps.ConvertToArgumentConversionException), staticFlags); + typeof(ExceptionHandlingOps).GetMethod(nameof(ExceptionHandlingOps.ConvertToArgumentConversionException), staticFlags, null, new Type[] { typeof(Exception), typeof(string), typeof(object), typeof(string), typeof(Type) }, null); internal static readonly MethodInfo ExceptionHandlingOps_ConvertToException = - typeof(ExceptionHandlingOps).GetMethod(nameof(ExceptionHandlingOps.ConvertToException), staticFlags); + typeof(ExceptionHandlingOps).GetMethod(nameof(ExceptionHandlingOps.ConvertToException), staticFlags, null, new Type[] { typeof(object), typeof(IScriptExtent) }, null); internal static readonly MethodInfo ExceptionHandlingOps_ConvertToMethodInvocationException = - typeof(ExceptionHandlingOps).GetMethod(nameof(ExceptionHandlingOps.ConvertToMethodInvocationException), staticFlags); + typeof(ExceptionHandlingOps).GetMethod(nameof(ExceptionHandlingOps.ConvertToMethodInvocationException), staticFlags, null, new Type[] { typeof(Exception), typeof(Type), typeof(string), typeof(int), typeof(MemberInfo) }, null); internal static readonly MethodInfo ExceptionHandlingOps_FindMatchingHandler = - typeof(ExceptionHandlingOps).GetMethod(nameof(ExceptionHandlingOps.FindMatchingHandler), staticFlags); + typeof(ExceptionHandlingOps).GetMethod(nameof(ExceptionHandlingOps.FindMatchingHandler), staticFlags, null, new Type[] { typeof(MutableTuple), typeof(RuntimeException), typeof(Type[]), typeof(ExecutionContext) }, null); internal static readonly MethodInfo ExceptionHandlingOps_RestoreStoppingPipeline = - typeof(ExceptionHandlingOps).GetMethod(nameof(ExceptionHandlingOps.RestoreStoppingPipeline), staticFlags); + typeof(ExceptionHandlingOps).GetMethod(nameof(ExceptionHandlingOps.RestoreStoppingPipeline), staticFlags, null, new Type[] { typeof(ExecutionContext), typeof(bool) }, null); internal static readonly MethodInfo ExceptionHandlingOps_SuspendStoppingPipeline = - typeof(ExceptionHandlingOps).GetMethod(nameof(ExceptionHandlingOps.SuspendStoppingPipeline), staticFlags); + typeof(ExceptionHandlingOps).GetMethod(nameof(ExceptionHandlingOps.SuspendStoppingPipeline), staticFlags, null, new Type[] { typeof(ExecutionContext) }, null); internal static readonly PropertyInfo ExecutionContext_CurrentExceptionBeingHandled = typeof(ExecutionContext).GetProperty(nameof(ExecutionContext.CurrentExceptionBeingHandled), instanceFlags); @@ -147,7 +147,7 @@ internal static class CachedReflectionInfo internal static readonly PropertyInfo ExecutionContext_ExceptionHandlerInEnclosingStatementBlock = typeof(ExecutionContext).GetProperty(nameof(ExecutionContext.PropagateExceptionsToEnclosingStatementBlock), instanceFlags); internal static readonly MethodInfo ExecutionContext_IsStrictVersion = - typeof(ExecutionContext).GetMethod(nameof(ExecutionContext.IsStrictVersion), staticFlags); + typeof(ExecutionContext).GetMethod(nameof(ExecutionContext.IsStrictVersion), staticFlags, null, new Type[] { typeof(ExecutionContext), typeof(int) }, null); internal static readonly PropertyInfo ExecutionContext_QuestionMarkVariableValue = typeof(ExecutionContext).GetProperty(nameof(ExecutionContext.QuestionMarkVariableValue), instanceFlags); internal static readonly PropertyInfo ExecutionContext_LanguageMode = @@ -155,14 +155,13 @@ internal static class CachedReflectionInfo internal static readonly PropertyInfo ExecutionContext_EngineIntrinsics = typeof(ExecutionContext).GetProperty(nameof(ExecutionContext.EngineIntrinsics), instanceFlags); internal static readonly MethodInfo FileRedirection_BindForExpression = - typeof(FileRedirection).GetMethod(nameof(FileRedirection.BindForExpression), instanceFlags); + typeof(FileRedirection).GetMethod(nameof(FileRedirection.BindForExpression), instanceFlags, null, new Type[] { typeof(FunctionContext) }, null); internal static readonly MethodInfo FileRedirection_CallDoCompleteForExpression = - typeof(FileRedirection).GetMethod(nameof(FileRedirection.CallDoCompleteForExpression), instanceFlags); + typeof(FileRedirection).GetMethod(nameof(FileRedirection.CallDoCompleteForExpression), instanceFlags, null, Type.EmptyTypes, null); internal static readonly ConstructorInfo FileRedirection_ctor = - typeof(FileRedirection).GetConstructor(instanceFlags, null, CallingConventions.Standard, - new Type[] { typeof(RedirectionStream), typeof(bool), typeof(string) }, null); + typeof(FileRedirection).GetConstructor(instanceFlags, null, CallingConventions.Standard, new Type[] { typeof(RedirectionStream), typeof(bool), typeof(string) }, null); internal static readonly MethodInfo FileRedirection_Dispose = - typeof(FileRedirection).GetMethod(nameof(FileRedirection.Dispose)); + typeof(FileRedirection).GetMethod(nameof(FileRedirection.Dispose), Type.EmptyTypes); internal static readonly FieldInfo FunctionContext__currentSequencePointIndex = typeof(FunctionContext).GetField(nameof(FunctionContext._currentSequencePointIndex), instanceFlags); @@ -175,21 +174,20 @@ internal static class CachedReflectionInfo internal static readonly FieldInfo FunctionContext__outputPipe = typeof(FunctionContext).GetField(nameof(FunctionContext._outputPipe), instanceFlags); internal static readonly MethodInfo FunctionContext_PopTrapHandlers = - typeof(FunctionContext).GetMethod(nameof(FunctionContext.PopTrapHandlers), instanceFlags); + typeof(FunctionContext).GetMethod(nameof(FunctionContext.PopTrapHandlers), instanceFlags, null, Type.EmptyTypes, null); internal static readonly MethodInfo FunctionContext_PushTrapHandlers = - typeof(FunctionContext).GetMethod(nameof(FunctionContext.PushTrapHandlers), instanceFlags); + typeof(FunctionContext).GetMethod(nameof(FunctionContext.PushTrapHandlers), instanceFlags, null, new Type[] { typeof(Type[]), typeof(Action[]), typeof(Type[]) }, null); internal static readonly MethodInfo FunctionOps_DefineFunction = - typeof(FunctionOps).GetMethod(nameof(FunctionOps.DefineFunction), staticFlags); + typeof(FunctionOps).GetMethod(nameof(FunctionOps.DefineFunction), staticFlags, null, new Type[] { typeof(ExecutionContext), typeof(FunctionDefinitionAst), typeof(ScriptBlockExpressionWrapper) }, null); internal static readonly ConstructorInfo Hashtable_ctor = - typeof(Hashtable).GetConstructor(BindingFlags.Instance | BindingFlags.Public, null, - CallingConventions.Standard, new Type[] { typeof(int), typeof(IEqualityComparer) }, null); + typeof(Hashtable).GetConstructor(BindingFlags.Instance | BindingFlags.Public, null, CallingConventions.Standard, new Type[] { typeof(int), typeof(IEqualityComparer) }, null); internal static readonly MethodInfo HashtableOps_Add = - typeof(HashtableOps).GetMethod(nameof(HashtableOps.Add), staticFlags); + typeof(HashtableOps).GetMethod(nameof(HashtableOps.Add), staticFlags, null, new Type[] { typeof(IDictionary), typeof(IDictionary) }, null); internal static readonly MethodInfo HashtableOps_AddKeyValuePair = - typeof(HashtableOps).GetMethod(nameof(HashtableOps.AddKeyValuePair), staticFlags); + typeof(HashtableOps).GetMethod(nameof(HashtableOps.AddKeyValuePair), staticFlags, null, new Type[] { typeof(IDictionary), typeof(object), typeof(object), typeof(IScriptExtent) }, null); internal static readonly PropertyInfo ICollection_Count = typeof(ICollection).GetProperty(nameof(ICollection.Count)); From 75e7d557061906b8e0e1471f2616cce41fe84d4d Mon Sep 17 00:00:00 2001 From: Ilya Date: Sat, 2 Mar 2019 23:54:02 +0500 Subject: [PATCH 05/23] Step 5 --- .../engine/parser/Compiler.cs | 34 +++++++++---------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/src/System.Management.Automation/engine/parser/Compiler.cs b/src/System.Management.Automation/engine/parser/Compiler.cs index d65404daaf6..53105429f34 100644 --- a/src/System.Management.Automation/engine/parser/Compiler.cs +++ b/src/System.Management.Automation/engine/parser/Compiler.cs @@ -193,18 +193,18 @@ internal static class CachedReflectionInfo typeof(ICollection).GetProperty(nameof(ICollection.Count)); internal static readonly MethodInfo IComparable_CompareTo = - typeof(IComparable).GetMethod(nameof(IComparable.CompareTo)); + typeof(IComparable).GetMethod(nameof(IComparable.CompareTo), new Type[] { typeof(object) }); internal static readonly MethodInfo IDisposable_Dispose = - typeof(IDisposable).GetMethod(nameof(IDisposable.Dispose)); + typeof(IDisposable).GetMethod(nameof(IDisposable.Dispose), Type.EmptyTypes); internal static readonly MethodInfo IEnumerable_GetEnumerator = - typeof(IEnumerable).GetMethod(nameof(IEnumerable.GetEnumerator)); + typeof(IEnumerable).GetMethod(nameof(IEnumerable.GetEnumerator), Type.EmptyTypes); internal static readonly PropertyInfo IEnumerator_Current = typeof(IEnumerator).GetProperty(nameof(IEnumerator.Current)); internal static readonly MethodInfo IEnumerator_MoveNext = - typeof(IEnumerator).GetMethod(nameof(IEnumerator.MoveNext)); + typeof(IEnumerator).GetMethod(nameof(IEnumerator.MoveNext), Type.EmptyTypes); internal static readonly MethodInfo IList_get_Item = typeof(IList).GetMethod("get_Item"); @@ -215,44 +215,42 @@ internal static class CachedReflectionInfo typeof(InterpreterError).GetMethod(nameof(InterpreterError.NewInterpreterExceptionWithInnerException), staticFlags); internal static readonly MethodInfo LanguagePrimitives_GetInvalidCastMessages = - typeof(LanguagePrimitives).GetMethod(nameof(LanguagePrimitives.GetInvalidCastMessages), staticFlags); + typeof(LanguagePrimitives).GetMethod(nameof(LanguagePrimitives.GetInvalidCastMessages), staticFlags, null, new Type[] { typeof(object), typeof(Type) }, null); internal static readonly MethodInfo LanguagePrimitives_ThrowInvalidCastException = - typeof(LanguagePrimitives).GetMethod(nameof(LanguagePrimitives.ThrowInvalidCastException), staticFlags); + typeof(LanguagePrimitives).GetMethod(nameof(LanguagePrimitives.ThrowInvalidCastException), staticFlags, null, new Type[] { typeof(object), typeof(Type) }, null); internal static readonly MethodInfo LocalPipeline_GetExecutionContextFromTLS = - typeof(LocalPipeline).GetMethod(nameof(LocalPipeline.GetExecutionContextFromTLS), staticFlags); + typeof(LocalPipeline).GetMethod(nameof(LocalPipeline.GetExecutionContextFromTLS), staticFlags, null, Type.EmptyTypes, null); internal static readonly MethodInfo LoopFlowException_MatchLabel = - typeof(LoopFlowException).GetMethod(nameof(LoopFlowException.MatchLabel), instanceFlags); + typeof(LoopFlowException).GetMethod(nameof(LoopFlowException.MatchLabel), instanceFlags, null, new Type[] { typeof(string) }, null); internal static readonly MethodInfo MergingRedirection_BindForExpression = - typeof(MergingRedirection).GetMethod(nameof(MergingRedirection.BindForExpression), instanceFlags); + typeof(MergingRedirection).GetMethod(nameof(MergingRedirection.BindForExpression), instanceFlags, null, new Type[] { typeof(ExecutionContext), typeof(FunctionContext) }, null); internal static readonly ConstructorInfo MethodException_ctor = - typeof(MethodException).GetConstructor(instanceFlags, null, - new Type[] { typeof(string), typeof(Exception), typeof(string), typeof(object[]) }, null); + typeof(MethodException).GetConstructor(instanceFlags, null, new Type[] { typeof(string), typeof(Exception), typeof(string), typeof(object[]) }, null); internal static readonly MethodInfo MutableTuple_IsValueSet = - typeof(MutableTuple).GetMethod(nameof(MutableTuple.IsValueSet), instanceFlags); + typeof(MutableTuple).GetMethod(nameof(MutableTuple.IsValueSet), instanceFlags, null, new Type[] { typeof(int) }, null); internal static readonly MethodInfo Object_Equals = typeof(object).GetMethod(nameof(object.Equals), new Type[] { typeof(object) }); internal static readonly ConstructorInfo OrderedDictionary_ctor = - typeof(OrderedDictionary).GetConstructor(BindingFlags.Instance | BindingFlags.Public, null, - CallingConventions.Standard, new Type[] { typeof(int), typeof(IEqualityComparer) }, null); + typeof(OrderedDictionary).GetConstructor(BindingFlags.Instance | BindingFlags.Public, null, CallingConventions.Standard, new Type[] { typeof(int), typeof(IEqualityComparer) }, null); internal static readonly MethodInfo Parser_ScanNumber = - typeof(Parser).GetMethod(nameof(Parser.ScanNumber), staticFlags); + typeof(Parser).GetMethod(nameof(Parser.ScanNumber), staticFlags, null, new Type[] { typeof(string), typeof(Type), typeof(bool) }, null); internal static readonly MethodInfo ParserOps_ContainsOperatorCompiled = typeof(ParserOps).GetMethod(nameof(ParserOps.ContainsOperatorCompiled), staticFlags); internal static readonly MethodInfo ParserOps_ImplicitOp = - typeof(ParserOps).GetMethod(nameof(ParserOps.ImplicitOp), staticFlags); + typeof(ParserOps).GetMethod(nameof(ParserOps.ImplicitOp), staticFlags, null, new Type[] { typeof(object), typeof(object), typeof(string), typeof(IScriptExtent), typeof(string) }, null); internal static readonly MethodInfo ParserOps_JoinOperator = - typeof(ParserOps).GetMethod(nameof(ParserOps.JoinOperator), staticFlags); + typeof(ParserOps).GetMethod(nameof(ParserOps.JoinOperator), staticFlags, null, new Type[] { typeof(ExecutionContext), typeof(IScriptExtent), typeof(object), typeof(object) }, null); internal static readonly MethodInfo ParserOps_LikeOperator = - typeof(ParserOps).GetMethod(nameof(ParserOps.LikeOperator), staticFlags); + typeof(ParserOps).GetMethod(nameof(ParserOps.LikeOperator), staticFlags, null, new Type[] { typeof(ExecutionContext), typeof(IScriptExtent), typeof(object), typeof(object), typeof(TokenKind) }, null); internal static readonly MethodInfo ParserOps_MatchOperator = typeof(ParserOps).GetMethod(nameof(ParserOps.MatchOperator), staticFlags); internal static readonly MethodInfo ParserOps_RangeOperator = From 0197507eb77d5a762221dd4f3ba310aaecac855f Mon Sep 17 00:00:00 2001 From: Ilya Date: Sun, 3 Mar 2019 19:22:58 +0500 Subject: [PATCH 06/23] Step 6 --- .../engine/parser/Compiler.cs | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/System.Management.Automation/engine/parser/Compiler.cs b/src/System.Management.Automation/engine/parser/Compiler.cs index 53105429f34..a7c282ee2d2 100644 --- a/src/System.Management.Automation/engine/parser/Compiler.cs +++ b/src/System.Management.Automation/engine/parser/Compiler.cs @@ -252,35 +252,35 @@ internal static class CachedReflectionInfo internal static readonly MethodInfo ParserOps_LikeOperator = typeof(ParserOps).GetMethod(nameof(ParserOps.LikeOperator), staticFlags, null, new Type[] { typeof(ExecutionContext), typeof(IScriptExtent), typeof(object), typeof(object), typeof(TokenKind) }, null); internal static readonly MethodInfo ParserOps_MatchOperator = - typeof(ParserOps).GetMethod(nameof(ParserOps.MatchOperator), staticFlags); + typeof(ParserOps).GetMethod(nameof(ParserOps.MatchOperator), staticFlags, null, new Type[] { typeof(ExecutionContext), typeof(IScriptExtent), typeof(object), typeof(object), typeof(bool), typeof(bool) }, null); internal static readonly MethodInfo ParserOps_RangeOperator = - typeof(ParserOps).GetMethod(nameof(ParserOps.RangeOperator), staticFlags); + typeof(ParserOps).GetMethod(nameof(ParserOps.RangeOperator), staticFlags, null, new Type[] { typeof(object), typeof(object) }, null); internal static readonly MethodInfo ParserOps_GetRangeEnumerator = - typeof(ParserOps).GetMethod(nameof(ParserOps.GetRangeEnumerator), staticFlags); + typeof(ParserOps).GetMethod(nameof(ParserOps.GetRangeEnumerator), staticFlags, null, new Type[] { typeof(object), typeof(object) }, null); internal static readonly MethodInfo ParserOps_ReplaceOperator = - typeof(ParserOps).GetMethod(nameof(ParserOps.ReplaceOperator), staticFlags); + typeof(ParserOps).GetMethod(nameof(ParserOps.ReplaceOperator), staticFlags, null, new Type[] { typeof(ExecutionContext), typeof(IScriptExtent), typeof(object), typeof(object), typeof(bool) }, null); internal static readonly MethodInfo ParserOps_SplitOperator = - typeof(ParserOps).GetMethod(nameof(ParserOps.SplitOperator), staticFlags); + typeof(ParserOps).GetMethod(nameof(ParserOps.SplitOperator), staticFlags, null, new Type[] { typeof(ExecutionContext), typeof(IScriptExtent), typeof(object), typeof(object), typeof(bool) }, null); internal static readonly MethodInfo ParserOps_UnaryJoinOperator = - typeof(ParserOps).GetMethod(nameof(ParserOps.UnaryJoinOperator), staticFlags); + typeof(ParserOps).GetMethod(nameof(ParserOps.UnaryJoinOperator), staticFlags, null, new Type[] { typeof(ExecutionContext), typeof(IScriptExtent), typeof(object) }, null); internal static readonly MethodInfo ParserOps_UnarySplitOperator = - typeof(ParserOps).GetMethod(nameof(ParserOps.UnarySplitOperator), staticFlags); + typeof(ParserOps).GetMethod(nameof(ParserOps.UnarySplitOperator), staticFlags, null, new Type[] { typeof(ExecutionContext), typeof(IScriptExtent), typeof(object) }, null); internal static readonly ConstructorInfo Pipe_ctor = typeof(Pipe).GetConstructor(instanceFlags, null, CallingConventions.Standard, new Type[] { typeof(List) }, null); internal static readonly MethodInfo Pipe_Add = - typeof(Pipe).GetMethod(nameof(Pipe.Add), instanceFlags); + typeof(Pipe).GetMethod(nameof(Pipe.Add), instanceFlags, null, new Type[] { typeof(object) }, null); internal static readonly MethodInfo Pipe_SetVariableListForTemporaryPipe = - typeof(Pipe).GetMethod(nameof(Pipe.SetVariableListForTemporaryPipe), instanceFlags); + typeof(Pipe).GetMethod(nameof(Pipe.SetVariableListForTemporaryPipe), instanceFlags, null, new Type[] { typeof(Pipe) }, null); internal static readonly MethodInfo PipelineOps_CheckAutomationNullInCommandArgument = - typeof(PipelineOps).GetMethod(nameof(PipelineOps.CheckAutomationNullInCommandArgument), staticFlags); + typeof(PipelineOps).GetMethod(nameof(PipelineOps.CheckAutomationNullInCommandArgument), staticFlags, null, new Type[] { typeof(object) }, null); internal static readonly MethodInfo PipelineOps_CheckAutomationNullInCommandArgumentArray = - typeof(PipelineOps).GetMethod(nameof(PipelineOps.CheckAutomationNullInCommandArgumentArray), staticFlags); + typeof(PipelineOps).GetMethod(nameof(PipelineOps.CheckAutomationNullInCommandArgumentArray), staticFlags, null, new Type[] { typeof(object[]) }, null); internal static readonly MethodInfo PipelineOps_CheckForInterrupts = - typeof(PipelineOps).GetMethod(nameof(PipelineOps.CheckForInterrupts), staticFlags); + typeof(PipelineOps).GetMethod(nameof(PipelineOps.CheckForInterrupts), staticFlags, null, new Type[] { typeof(ExecutionContext) }, null); internal static readonly MethodInfo PipelineOps_GetExitException = - typeof(PipelineOps).GetMethod(nameof(PipelineOps.GetExitException), staticFlags); + typeof(PipelineOps).GetMethod(nameof(PipelineOps.GetExitException), staticFlags, null, new Type[] { typeof(object) }, null); internal static readonly MethodInfo PipelineOps_FlushPipe = typeof(PipelineOps).GetMethod(nameof(PipelineOps.FlushPipe), staticFlags); internal static readonly MethodInfo PipelineOps_InvokePipeline = @@ -288,7 +288,7 @@ internal static class CachedReflectionInfo internal static readonly MethodInfo PipelineOps_InvokePipelineInBackground = typeof(PipelineOps).GetMethod(nameof(PipelineOps.InvokePipelineInBackground), staticFlags); internal static readonly MethodInfo PipelineOps_Nop = - typeof(PipelineOps).GetMethod(nameof(PipelineOps.Nop), staticFlags); + typeof(PipelineOps).GetMethod(nameof(PipelineOps.Nop), staticFlags, null, Type.EmptyTypes, null); internal static readonly MethodInfo PipelineOps_PipelineResult = typeof(PipelineOps).GetMethod(nameof(PipelineOps.PipelineResult), staticFlags); internal static readonly MethodInfo PipelineOps_ClearPipe = From e7766b1de6f1b5dc0ffa6bb2a87c08fb90a2d443 Mon Sep 17 00:00:00 2001 From: Ilya Date: Sun, 3 Mar 2019 20:32:40 +0500 Subject: [PATCH 07/23] Step 7 --- .../engine/parser/Compiler.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/System.Management.Automation/engine/parser/Compiler.cs b/src/System.Management.Automation/engine/parser/Compiler.cs index a7c282ee2d2..b1cf6a9b218 100644 --- a/src/System.Management.Automation/engine/parser/Compiler.cs +++ b/src/System.Management.Automation/engine/parser/Compiler.cs @@ -282,17 +282,17 @@ internal static class CachedReflectionInfo internal static readonly MethodInfo PipelineOps_GetExitException = typeof(PipelineOps).GetMethod(nameof(PipelineOps.GetExitException), staticFlags, null, new Type[] { typeof(object) }, null); internal static readonly MethodInfo PipelineOps_FlushPipe = - typeof(PipelineOps).GetMethod(nameof(PipelineOps.FlushPipe), staticFlags); + typeof(PipelineOps).GetMethod(nameof(PipelineOps.FlushPipe), staticFlags, null, new Type[] { typeof(Pipe), typeof(List) }, null); internal static readonly MethodInfo PipelineOps_InvokePipeline = - typeof(PipelineOps).GetMethod(nameof(PipelineOps.InvokePipeline), staticFlags); + typeof(PipelineOps).GetMethod(nameof(PipelineOps.InvokePipeline), staticFlags, null, new Type[] { typeof(object), typeof(bool), typeof(CommandParameterInternal[][]), typeof(CommandBaseAst[]), typeof(CommandRedirection[][]), typeof(FunctionContext) }, null); internal static readonly MethodInfo PipelineOps_InvokePipelineInBackground = - typeof(PipelineOps).GetMethod(nameof(PipelineOps.InvokePipelineInBackground), staticFlags); + typeof(PipelineOps).GetMethod(nameof(PipelineOps.InvokePipelineInBackground), staticFlags, null, new Type[] { typeof(PipelineAst), typeof(FunctionContext) }, null); internal static readonly MethodInfo PipelineOps_Nop = typeof(PipelineOps).GetMethod(nameof(PipelineOps.Nop), staticFlags, null, Type.EmptyTypes, null); internal static readonly MethodInfo PipelineOps_PipelineResult = - typeof(PipelineOps).GetMethod(nameof(PipelineOps.PipelineResult), staticFlags); + typeof(PipelineOps).GetMethod(nameof(PipelineOps.PipelineResult), staticFlags, null, new Type[] { typeof(List) }, null); internal static readonly MethodInfo PipelineOps_ClearPipe = - typeof(PipelineOps).GetMethod(nameof(PipelineOps.ClearPipe), staticFlags); + typeof(PipelineOps).GetMethod(nameof(PipelineOps.ClearPipe), staticFlags, null, new Type[] { typeof(List) }, null); internal static readonly MethodInfo PSGetDynamicMemberBinder_GetIDictionaryMember = typeof(PSGetDynamicMemberBinder).GetMethod(nameof(PSGetDynamicMemberBinder.GetIDictionaryMember), staticFlags); From 22472fa289ca6ac6948c860db41e42e2376d6bac Mon Sep 17 00:00:00 2001 From: Ilya Date: Sun, 3 Mar 2019 21:39:08 +0500 Subject: [PATCH 08/23] Step 8 --- .../engine/parser/Compiler.cs | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/System.Management.Automation/engine/parser/Compiler.cs b/src/System.Management.Automation/engine/parser/Compiler.cs index b1cf6a9b218..c77548e7dc6 100644 --- a/src/System.Management.Automation/engine/parser/Compiler.cs +++ b/src/System.Management.Automation/engine/parser/Compiler.cs @@ -295,33 +295,33 @@ internal static class CachedReflectionInfo typeof(PipelineOps).GetMethod(nameof(PipelineOps.ClearPipe), staticFlags, null, new Type[] { typeof(List) }, null); internal static readonly MethodInfo PSGetDynamicMemberBinder_GetIDictionaryMember = - typeof(PSGetDynamicMemberBinder).GetMethod(nameof(PSGetDynamicMemberBinder.GetIDictionaryMember), staticFlags); + typeof(PSGetDynamicMemberBinder).GetMethod(nameof(PSGetDynamicMemberBinder.GetIDictionaryMember), staticFlags, null, new Type[] { typeof(IDictionary), typeof(object) }, null); internal static readonly MethodInfo PSGetMemberBinder_CloneMemberInfo = - typeof(PSGetMemberBinder).GetMethod(nameof(PSGetMemberBinder.CloneMemberInfo), staticFlags); + typeof(PSGetMemberBinder).GetMethod(nameof(PSGetMemberBinder.CloneMemberInfo), staticFlags, null, new Type[] { typeof(PSMemberInfo), typeof(object) }, null); internal static readonly MethodInfo PSGetMemberBinder_GetAdaptedValue = - typeof(PSGetMemberBinder).GetMethod(nameof(PSGetMemberBinder.GetAdaptedValue), staticFlags); + typeof(PSGetMemberBinder).GetMethod(nameof(PSGetMemberBinder.GetAdaptedValue), staticFlags, null, new Type[] { typeof(object), typeof(string) }, null); internal static readonly MethodInfo PSGetMemberBinder_GetTypeTableFromTLS = - typeof(PSGetMemberBinder).GetMethod(nameof(PSGetMemberBinder.GetTypeTableFromTLS), staticFlags); + typeof(PSGetMemberBinder).GetMethod(nameof(PSGetMemberBinder.GetTypeTableFromTLS), staticFlags, null, Type.EmptyTypes, null); internal static readonly MethodInfo PSGetMemberBinder_IsTypeNameSame = - typeof(PSGetMemberBinder).GetMethod(nameof(PSGetMemberBinder.IsTypeNameSame), staticFlags); + typeof(PSGetMemberBinder).GetMethod(nameof(PSGetMemberBinder.IsTypeNameSame), staticFlags, null, new Type[] { typeof(object), typeof(string) }, null); internal static readonly MethodInfo PSGetMemberBinder_TryGetGenericDictionaryValue = typeof(PSGetMemberBinder).GetMethod(nameof(PSGetMemberBinder.TryGetGenericDictionaryValue), staticFlags); internal static readonly MethodInfo PSGetMemberBinder_TryGetInstanceMember = - typeof(PSGetMemberBinder).GetMethod(nameof(PSGetMemberBinder.TryGetInstanceMember), staticFlags); + typeof(PSGetMemberBinder).GetMethod(nameof(PSGetMemberBinder.TryGetInstanceMember), staticFlags, null, new Type[] { typeof(object), typeof(string), typeof(MemberInfo) }, null); internal static readonly MethodInfo PSGetMemberBinder_TryGetIDictionaryValue = - typeof(PSGetMemberBinder).GetMethod(nameof(PSGetMemberBinder.TryGetIDictionaryValue), staticFlags); + typeof(PSGetMemberBinder).GetMethod(nameof(PSGetMemberBinder.TryGetIDictionaryValue), staticFlags, null, new Type[] { typeof(IDictionary), typeof(string), typeof(object) }, null); internal static readonly MethodInfo PSInvokeMemberBinder_InvokeAdaptedMember = - typeof(PSInvokeMemberBinder).GetMethod(nameof(PSInvokeMemberBinder.InvokeAdaptedMember), staticFlags); + typeof(PSInvokeMemberBinder).GetMethod(nameof(PSInvokeMemberBinder.InvokeAdaptedMember), staticFlags, null, new Type[] { typeof(object), typeof(string), typeof(object[]) }, null); internal static readonly MethodInfo PSInvokeMemberBinder_InvokeAdaptedSetMember = - typeof(PSInvokeMemberBinder).GetMethod(nameof(PSInvokeMemberBinder.InvokeAdaptedSetMember), staticFlags); + typeof(PSInvokeMemberBinder).GetMethod(nameof(PSInvokeMemberBinder.InvokeAdaptedSetMember), staticFlags, null, new Type[] { typeof(object), typeof(string), typeof(object[]), typeof(object) }, null); internal static readonly MethodInfo PSInvokeMemberBinder_IsHeterogeneousArray = - typeof(PSInvokeMemberBinder).GetMethod(nameof(PSInvokeMemberBinder.IsHeterogeneousArray), staticFlags); + typeof(PSInvokeMemberBinder).GetMethod(nameof(PSInvokeMemberBinder.IsHeterogeneousArray), staticFlags, null, new Type[] { typeof(object[]) }, null); internal static readonly MethodInfo PSInvokeMemberBinder_IsHomogenousArray = - typeof(PSInvokeMemberBinder).GetMethod(nameof(PSInvokeMemberBinder.IsHomogenousArray), staticFlags); + typeof(PSInvokeMemberBinder).GetMethod(nameof(PSInvokeMemberBinder.IsHomogenousArray), staticFlags, null, new Type[] { typeof(object[]) }, null); internal static readonly MethodInfo PSInvokeMemberBinder_TryGetInstanceMethod = - typeof(PSInvokeMemberBinder).GetMethod(nameof(PSInvokeMemberBinder.TryGetInstanceMethod), staticFlags); + typeof(PSInvokeMemberBinder).GetMethod(nameof(PSInvokeMemberBinder.TryGetInstanceMethod), staticFlags, null, new Type[] { typeof(object), typeof(string), typeof(PSMethodInfo) }, null); internal static readonly MethodInfo PSMethodInfo_Invoke = typeof(PSMethodInfo).GetMethod(nameof(PSMethodInfo.Invoke)); From 3f910c21689a61ca2eabe20eec853c18567a0cf4 Mon Sep 17 00:00:00 2001 From: Ilya Date: Sun, 3 Mar 2019 21:50:56 +0500 Subject: [PATCH 09/23] Step 9 --- .../engine/parser/Compiler.cs | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/System.Management.Automation/engine/parser/Compiler.cs b/src/System.Management.Automation/engine/parser/Compiler.cs index c77548e7dc6..16b520e433b 100644 --- a/src/System.Management.Automation/engine/parser/Compiler.cs +++ b/src/System.Management.Automation/engine/parser/Compiler.cs @@ -308,9 +308,9 @@ internal static class CachedReflectionInfo internal static readonly MethodInfo PSGetMemberBinder_TryGetGenericDictionaryValue = typeof(PSGetMemberBinder).GetMethod(nameof(PSGetMemberBinder.TryGetGenericDictionaryValue), staticFlags); internal static readonly MethodInfo PSGetMemberBinder_TryGetInstanceMember = - typeof(PSGetMemberBinder).GetMethod(nameof(PSGetMemberBinder.TryGetInstanceMember), staticFlags, null, new Type[] { typeof(object), typeof(string), typeof(MemberInfo) }, null); + typeof(PSGetMemberBinder).GetMethod(nameof(PSGetMemberBinder.TryGetInstanceMember), staticFlags); internal static readonly MethodInfo PSGetMemberBinder_TryGetIDictionaryValue = - typeof(PSGetMemberBinder).GetMethod(nameof(PSGetMemberBinder.TryGetIDictionaryValue), staticFlags, null, new Type[] { typeof(IDictionary), typeof(string), typeof(object) }, null); + typeof(PSGetMemberBinder).GetMethod(nameof(PSGetMemberBinder.TryGetIDictionaryValue), staticFlags); internal static readonly MethodInfo PSInvokeMemberBinder_InvokeAdaptedMember = typeof(PSInvokeMemberBinder).GetMethod(nameof(PSInvokeMemberBinder.InvokeAdaptedMember), staticFlags, null, new Type[] { typeof(object), typeof(string), typeof(object[]) }, null); @@ -321,7 +321,7 @@ internal static class CachedReflectionInfo internal static readonly MethodInfo PSInvokeMemberBinder_IsHomogenousArray = typeof(PSInvokeMemberBinder).GetMethod(nameof(PSInvokeMemberBinder.IsHomogenousArray), staticFlags, null, new Type[] { typeof(object[]) }, null); internal static readonly MethodInfo PSInvokeMemberBinder_TryGetInstanceMethod = - typeof(PSInvokeMemberBinder).GetMethod(nameof(PSInvokeMemberBinder.TryGetInstanceMethod), staticFlags, null, new Type[] { typeof(object), typeof(string), typeof(PSMethodInfo) }, null); + typeof(PSInvokeMemberBinder).GetMethod(nameof(PSInvokeMemberBinder.TryGetInstanceMethod), staticFlags); internal static readonly MethodInfo PSMethodInfo_Invoke = typeof(PSMethodInfo).GetMethod(nameof(PSMethodInfo.Invoke)); @@ -342,15 +342,15 @@ internal static class CachedReflectionInfo typeof(PSReference).GetProperty(nameof(PSReference.Value)); internal static readonly MethodInfo PSScriptMethod_InvokeScript = - typeof(PSScriptMethod).GetMethod(nameof(PSScriptMethod.InvokeScript), staticFlags); + typeof(PSScriptMethod).GetMethod(nameof(PSScriptMethod.InvokeScript), staticFlags, null, new Type[] { typeof(string), typeof(ScriptBlock), typeof(object), typeof(object[]) }, null); internal static readonly MethodInfo PSScriptProperty_InvokeGetter = - typeof(PSScriptProperty).GetMethod(nameof(PSScriptProperty.InvokeGetter), instanceFlags); + typeof(PSScriptProperty).GetMethod(nameof(PSScriptProperty.InvokeGetter), instanceFlags, null, new Type[] { typeof(object) }, null); internal static readonly MethodInfo PSScriptProperty_InvokeSetter = - typeof(PSScriptProperty).GetMethod(nameof(PSScriptProperty.InvokeSetter), instanceFlags); + typeof(PSScriptProperty).GetMethod(nameof(PSScriptProperty.InvokeSetter), instanceFlags, null, new Type[] { typeof(object), typeof(object) }, null); internal static readonly MethodInfo PSSetMemberBinder_SetAdaptedValue = - typeof(PSSetMemberBinder).GetMethod(nameof(PSSetMemberBinder.SetAdaptedValue), staticFlags); + typeof(PSSetMemberBinder).GetMethod(nameof(PSSetMemberBinder.SetAdaptedValue), staticFlags, null, new Type[] { typeof(object), typeof(string), typeof(object) }, null); internal static readonly MethodInfo PSVariableAssignmentBinder_CopyInstanceMembersOfValueType = typeof(PSVariableAssignmentBinder).GetMethod(nameof(PSVariableAssignmentBinder.CopyInstanceMembersOfValueType), staticFlags); @@ -358,22 +358,22 @@ internal static class CachedReflectionInfo typeof(PSVariableAssignmentBinder).GetField(nameof(PSVariableAssignmentBinder.s_mutableValueWithInstanceMemberVersion), staticFlags); internal static readonly MethodInfo PSCreateInstanceBinder_IsTargetTypeNonPublic = - typeof(PSCreateInstanceBinder).GetMethod(nameof(PSCreateInstanceBinder.IsTargetTypeNonPublic), staticFlags); + typeof(PSCreateInstanceBinder).GetMethod(nameof(PSCreateInstanceBinder.IsTargetTypeNonPublic), staticFlags, null, new Type[] { typeof(object) }, null); internal static readonly MethodInfo PSCreateInstanceBinder_IsTargetTypeByRefLike = - typeof(PSCreateInstanceBinder).GetMethod(nameof(PSCreateInstanceBinder.IsTargetTypeByRefLike), staticFlags); + typeof(PSCreateInstanceBinder).GetMethod(nameof(PSCreateInstanceBinder.IsTargetTypeByRefLike), staticFlags, null, new Type[] { typeof(object) }, null); internal static readonly MethodInfo PSCreateInstanceBinder_GetTargetTypeName = - typeof(PSCreateInstanceBinder).GetMethod(nameof(PSCreateInstanceBinder.GetTargetTypeName), staticFlags); + typeof(PSCreateInstanceBinder).GetMethod(nameof(PSCreateInstanceBinder.GetTargetTypeName), staticFlags, null, new Type[] { typeof(object) }, null); internal static readonly MethodInfo ReservedNameMembers_GeneratePSAdaptedMemberSet = - typeof(ReservedNameMembers).GetMethod(nameof(ReservedNameMembers.GeneratePSAdaptedMemberSet), staticFlags); + typeof(ReservedNameMembers).GetMethod(nameof(ReservedNameMembers.GeneratePSAdaptedMemberSet), staticFlags, null, new Type[] { typeof(object) }, null); internal static readonly MethodInfo ReservedNameMembers_GeneratePSBaseMemberSet = - typeof(ReservedNameMembers).GetMethod(nameof(ReservedNameMembers.GeneratePSBaseMemberSet), staticFlags); + typeof(ReservedNameMembers).GetMethod(nameof(ReservedNameMembers.GeneratePSBaseMemberSet), staticFlags, null, new Type[] { typeof(object) }, null); internal static readonly MethodInfo ReservedNameMembers_GeneratePSExtendedMemberSet = - typeof(ReservedNameMembers).GetMethod(nameof(ReservedNameMembers.GeneratePSExtendedMemberSet), staticFlags); + typeof(ReservedNameMembers).GetMethod(nameof(ReservedNameMembers.GeneratePSExtendedMemberSet), staticFlags, null, new Type[] { typeof(object) }, null); internal static readonly MethodInfo ReservedNameMembers_GeneratePSObjectMemberSet = - typeof(ReservedNameMembers).GetMethod(nameof(ReservedNameMembers.GeneratePSObjectMemberSet), staticFlags); + typeof(ReservedNameMembers).GetMethod(nameof(ReservedNameMembers.GeneratePSObjectMemberSet), staticFlags, null, new Type[] { typeof(object) }, null); internal static readonly MethodInfo ReservedNameMembers_PSTypeNames = - typeof(ReservedNameMembers).GetMethod(nameof(ReservedNameMembers.PSTypeNames)); + typeof(ReservedNameMembers).GetMethod(nameof(ReservedNameMembers.PSTypeNames), new Type[] { typeof(PSObject) }); internal static readonly MethodInfo RestrictedLanguageChecker_CheckDataStatementLanguageModeAtRuntime = typeof(RestrictedLanguageChecker).GetMethod(nameof(RestrictedLanguageChecker.CheckDataStatementLanguageModeAtRuntime), staticFlags); From 0a8f4c0062b37d70f6296426597b16c276851a76 Mon Sep 17 00:00:00 2001 From: Ilya Date: Sun, 3 Mar 2019 23:10:48 +0500 Subject: [PATCH 10/23] Step 10 --- .../engine/parser/Compiler.cs | 33 ++++++++----------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/src/System.Management.Automation/engine/parser/Compiler.cs b/src/System.Management.Automation/engine/parser/Compiler.cs index 16b520e433b..1444c63b458 100644 --- a/src/System.Management.Automation/engine/parser/Compiler.cs +++ b/src/System.Management.Automation/engine/parser/Compiler.cs @@ -376,12 +376,12 @@ internal static class CachedReflectionInfo typeof(ReservedNameMembers).GetMethod(nameof(ReservedNameMembers.PSTypeNames), new Type[] { typeof(PSObject) }); internal static readonly MethodInfo RestrictedLanguageChecker_CheckDataStatementLanguageModeAtRuntime = - typeof(RestrictedLanguageChecker).GetMethod(nameof(RestrictedLanguageChecker.CheckDataStatementLanguageModeAtRuntime), staticFlags); + typeof(RestrictedLanguageChecker).GetMethod(nameof(RestrictedLanguageChecker.CheckDataStatementLanguageModeAtRuntime), staticFlags, null, new Type[] { typeof(DataStatementAst), typeof(ExecutionContext) }, null); internal static readonly MethodInfo RestrictedLanguageChecker_CheckDataStatementAstAtRuntime = - typeof(RestrictedLanguageChecker).GetMethod(nameof(RestrictedLanguageChecker.CheckDataStatementAstAtRuntime), staticFlags); + typeof(RestrictedLanguageChecker).GetMethod(nameof(RestrictedLanguageChecker.CheckDataStatementAstAtRuntime), staticFlags, null, new Type[] { typeof(DataStatementAst), typeof(string[]) }, null); internal static readonly MethodInfo RestrictedLanguageChecker_EnsureUtilityModuleLoaded = - typeof(RestrictedLanguageChecker).GetMethod(nameof(RestrictedLanguageChecker.EnsureUtilityModuleLoaded), staticFlags); + typeof(RestrictedLanguageChecker).GetMethod(nameof(RestrictedLanguageChecker.EnsureUtilityModuleLoaded), staticFlags, null, new Type[] { typeof(ExecutionContext) }, null); internal static readonly ConstructorInfo ReturnException_ctor = typeof(ReturnException).GetConstructor(instanceFlags, null, CallingConventions.Standard, new Type[] { typeof(object) }, null); @@ -390,40 +390,35 @@ internal static class CachedReflectionInfo typeof(RuntimeException).GetProperty(nameof(RuntimeException.ErrorRecord)); internal static readonly MethodInfo ScriptBlock_DoInvokeReturnAsIs = - typeof(ScriptBlock).GetMethod(nameof(ScriptBlock.DoInvokeReturnAsIs), instanceFlags); + typeof(ScriptBlock).GetMethod(nameof(ScriptBlock.DoInvokeReturnAsIs), instanceFlags, null, new Type[] { typeof(bool), typeof(ScriptBlock.ErrorHandlingBehavior), typeof(object), typeof(object), typeof(object), typeof(object[]) }, null); internal static readonly MethodInfo ScriptBlock_InvokeAsDelegateHelper = - typeof(ScriptBlock).GetMethod(nameof(ScriptBlock.InvokeAsDelegateHelper), instanceFlags); + typeof(ScriptBlock).GetMethod(nameof(ScriptBlock.InvokeAsDelegateHelper), instanceFlags, null, new Type[] { typeof(object), typeof(object), typeof(object[]) }, null); internal static readonly MethodInfo ScriptBlockExpressionWrapper_GetScriptBlock = - typeof(ScriptBlockExpressionWrapper).GetMethod(nameof(ScriptBlockExpressionWrapper.GetScriptBlock), instanceFlags); + typeof(ScriptBlockExpressionWrapper).GetMethod(nameof(ScriptBlockExpressionWrapper.GetScriptBlock), instanceFlags, null, new Type[] { typeof(ExecutionContext), typeof(bool) }, null); internal static readonly ConstructorInfo SetValueException_ctor = - typeof(SetValueException).GetConstructor(instanceFlags, null, - new[] { typeof(string), typeof(Exception), typeof(string), typeof(object[]) }, null); + typeof(SetValueException).GetConstructor(instanceFlags, null, new[] { typeof(string), typeof(Exception), typeof(string), typeof(object[]) }, null); internal static readonly ConstructorInfo GetValueException_ctor = - typeof(GetValueException).GetConstructor(instanceFlags, null, - new[] { typeof(string), typeof(Exception), typeof(string), typeof(object[]) }, null); + typeof(GetValueException).GetConstructor(instanceFlags, null, new[] { typeof(string), typeof(Exception), typeof(string), typeof(object[]) }, null); internal static readonly ConstructorInfo StreamReader_ctor = typeof(StreamReader).GetConstructor(new Type[] { typeof(string) }); internal static readonly MethodInfo StreamReader_ReadLine = - typeof(StreamReader).GetMethod(nameof(StreamReader.ReadLine)); + typeof(StreamReader).GetMethod(nameof(StreamReader.ReadLine), Type.EmptyTypes); internal static readonly ConstructorInfo String_ctor_char_int = typeof(string).GetConstructor(new Type[] { typeof(char), typeof(int) }); internal static readonly MethodInfo String_Concat_String = - typeof(string).GetMethod(nameof(string.Concat), staticPublicFlags, null, - CallingConventions.Standard, new Type[] { typeof(string), typeof(string) }, null); + typeof(string).GetMethod(nameof(string.Concat), staticPublicFlags, null, CallingConventions.Standard, new Type[] { typeof(string), typeof(string) }, null); internal static readonly MethodInfo String_Equals = - typeof(string).GetMethod(nameof(string.Equals), staticPublicFlags, null, - CallingConventions.Standard, - new Type[] { typeof(string), typeof(string), typeof(StringComparison) }, null); + typeof(string).GetMethod(nameof(string.Equals), staticPublicFlags, null, CallingConventions.Standard, new Type[] { typeof(string), typeof(string), typeof(StringComparison) }, null); internal static readonly MethodInfo StringOps_Compare = - typeof(StringOps).GetMethod(nameof(StringOps.Compare), staticFlags); + typeof(StringOps).GetMethod(nameof(StringOps.Compare), staticFlags, null, CallingConventions.Standard, new Type[] { typeof(string), typeof(string), typeof(CultureInfo), typeof(CompareOptions) }, null); internal static readonly MethodInfo StringOps_Equals = - typeof(StringOps).GetMethod(nameof(StringOps.Equals), staticFlags); + typeof(StringOps).GetMethod(nameof(StringOps.Equals), staticFlags, null, CallingConventions.Standard, new Type[] { typeof(string), typeof(string), typeof(CultureInfo), typeof(CompareOptions) }, null); internal static readonly MethodInfo StringOps_FormatOperator = - typeof(StringOps).GetMethod(nameof(StringOps.FormatOperator), staticFlags); + typeof(StringOps).GetMethod(nameof(StringOps.FormatOperator), staticFlags, null, CallingConventions.Standard, new Type[] { typeof(string), typeof(object) }, null); internal static readonly MethodInfo StringOps_Multiply = typeof(StringOps).GetMethod(nameof(StringOps.Multiply), staticFlags); From 8058847b2414a3ada498d069ea05a2cc4507a689 Mon Sep 17 00:00:00 2001 From: Ilya Date: Sun, 3 Mar 2019 23:42:26 +0500 Subject: [PATCH 11/23] Step 11 --- .../engine/parser/Compiler.cs | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/System.Management.Automation/engine/parser/Compiler.cs b/src/System.Management.Automation/engine/parser/Compiler.cs index 1444c63b458..166145beae6 100644 --- a/src/System.Management.Automation/engine/parser/Compiler.cs +++ b/src/System.Management.Automation/engine/parser/Compiler.cs @@ -420,55 +420,55 @@ internal static class CachedReflectionInfo internal static readonly MethodInfo StringOps_FormatOperator = typeof(StringOps).GetMethod(nameof(StringOps.FormatOperator), staticFlags, null, CallingConventions.Standard, new Type[] { typeof(string), typeof(object) }, null); internal static readonly MethodInfo StringOps_Multiply = - typeof(StringOps).GetMethod(nameof(StringOps.Multiply), staticFlags); + typeof(StringOps).GetMethod(nameof(StringOps.Multiply), staticFlags, null, new Type[] { typeof(string), typeof(int) }, null); internal static readonly MethodInfo SwitchOps_ConditionSatisfiedRegex = - typeof(SwitchOps).GetMethod(nameof(SwitchOps.ConditionSatisfiedRegex), staticFlags); + typeof(SwitchOps).GetMethod(nameof(SwitchOps.ConditionSatisfiedRegex), staticFlags, null, new Type[] { typeof(bool), typeof(object), typeof(IScriptExtent), typeof(string), typeof(ExecutionContext) }, null); internal static readonly MethodInfo SwitchOps_ConditionSatisfiedWildcard = - typeof(SwitchOps).GetMethod(nameof(SwitchOps.ConditionSatisfiedWildcard), staticFlags); + typeof(SwitchOps).GetMethod(nameof(SwitchOps.ConditionSatisfiedWildcard), staticFlags, null, new Type[] { typeof(bool), typeof(object), typeof(string), typeof(ExecutionContext) }, null); internal static readonly MethodInfo SwitchOps_ResolveFilePath = - typeof(SwitchOps).GetMethod(nameof(SwitchOps.ResolveFilePath), staticFlags); + typeof(SwitchOps).GetMethod(nameof(SwitchOps.ResolveFilePath), staticFlags, null, new Type[] { typeof(IScriptExtent), typeof(object), typeof(ExecutionContext) }, null); internal static readonly MethodInfo TypeOps_AsOperator = - typeof(TypeOps).GetMethod(nameof(TypeOps.AsOperator), staticFlags); + typeof(TypeOps).GetMethod(nameof(TypeOps.AsOperator), staticFlags, null, new Type[] { typeof(object), typeof(Type) }, null); internal static readonly MethodInfo TypeOps_AddPowerShellTypesToTheScope = - typeof(TypeOps).GetMethod(nameof(TypeOps.AddPowerShellTypesToTheScope), staticFlags); + typeof(TypeOps).GetMethod(nameof(TypeOps.AddPowerShellTypesToTheScope), staticFlags, null, new Type[] { typeof(Dictionary), typeof(ExecutionContext) }, null); internal static readonly MethodInfo TypeOps_InitPowerShellTypesAtRuntime = - typeof(TypeOps).GetMethod(nameof(TypeOps.InitPowerShellTypesAtRuntime), staticFlags); + typeof(TypeOps).GetMethod(nameof(TypeOps.InitPowerShellTypesAtRuntime), staticFlags, null, new Type[] { typeof(TypeDefinitionAst[]) }, null); internal static readonly MethodInfo TypeOps_SetCurrentTypeResolutionState = - typeof(TypeOps).GetMethod(nameof(TypeOps.SetCurrentTypeResolutionState), staticFlags); + typeof(TypeOps).GetMethod(nameof(TypeOps.SetCurrentTypeResolutionState), staticFlags, null, new Type[] { typeof(TypeResolutionState), typeof(ExecutionContext) }, null); internal static readonly MethodInfo TypeOps_SetAssemblyDefiningPSTypes = - typeof(TypeOps).GetMethod(nameof(TypeOps.SetAssemblyDefiningPSTypes), staticFlags); + typeof(TypeOps).GetMethod(nameof(TypeOps.SetAssemblyDefiningPSTypes), staticFlags, null, new Type[] { typeof(FunctionContext), typeof(Assembly) }, null); internal static readonly MethodInfo TypeOps_IsInstance = - typeof(TypeOps).GetMethod(nameof(TypeOps.IsInstance), staticFlags); + typeof(TypeOps).GetMethod(nameof(TypeOps.IsInstance), staticFlags, null, new Type[] { typeof(object), typeof(object) }, null); internal static readonly MethodInfo TypeOps_ResolveTypeName = - typeof(TypeOps).GetMethod(nameof(TypeOps.ResolveTypeName), staticFlags); + typeof(TypeOps).GetMethod(nameof(TypeOps.ResolveTypeName), staticFlags, null, new Type[] { typeof(ITypeName), typeof(IScriptExtent) }, null); internal static readonly MethodInfo VariableOps_GetUsingValue = - typeof(VariableOps).GetMethod(nameof(VariableOps.GetUsingValue), staticFlags); + typeof(VariableOps).GetMethod(nameof(VariableOps.GetUsingValue), staticFlags, null, new Type[] { typeof(MutableTuple), typeof(string), typeof(int), typeof(ExecutionContext) }, null); internal static readonly MethodInfo VariableOps_GetVariableAsRef = - typeof(VariableOps).GetMethod(nameof(VariableOps.GetVariableAsRef), staticFlags); + typeof(VariableOps).GetMethod(nameof(VariableOps.GetVariableAsRef), staticFlags, null, new Type[] { typeof(VariablePath), typeof(ExecutionContext), typeof(Type) }, null); internal static readonly MethodInfo VariableOps_GetVariableValue = - typeof(VariableOps).GetMethod(nameof(VariableOps.GetVariableValue), staticFlags); + typeof(VariableOps).GetMethod(nameof(VariableOps.GetVariableValue), staticFlags, null, new Type[] { typeof(VariablePath), typeof(ExecutionContext), typeof(VariableExpressionAst) }, null); internal static readonly MethodInfo VariableOps_GetAutomaticVariableValue = - typeof(VariableOps).GetMethod(nameof(VariableOps.GetAutomaticVariableValue), staticFlags); + typeof(VariableOps).GetMethod(nameof(VariableOps.GetAutomaticVariableValue), staticFlags, null, new Type[] { typeof(int), typeof(ExecutionContext), typeof(VariableExpressionAst) }, null); internal static readonly MethodInfo VariableOps_SetVariableValue = - typeof(VariableOps).GetMethod(nameof(VariableOps.SetVariableValue), staticFlags); + typeof(VariableOps).GetMethod(nameof(VariableOps.SetVariableValue), staticFlags, null, new Type[] { typeof(VariablePath), typeof(object), typeof(ExecutionContext), typeof(AttributeBaseAst[]) }, null); internal static readonly MethodInfo Utils_IsComObject = - typeof(Utils).GetMethod(nameof(Utils.IsComObject), staticFlags); + typeof(Utils).GetMethod(nameof(Utils.IsComObject), staticFlags, null, new Type[] { typeof(object) }, null); internal static readonly MethodInfo ClassOps_ValidateSetProperty = - typeof(ClassOps).GetMethod(nameof(ClassOps.ValidateSetProperty), staticPublicFlags); + typeof(ClassOps).GetMethod(nameof(ClassOps.ValidateSetProperty), staticPublicFlags, null, new Type[] { typeof(Type), typeof(string), typeof(object) }, null); internal static readonly MethodInfo ClassOps_CallBaseCtor = - typeof(ClassOps).GetMethod(nameof(ClassOps.CallBaseCtor), staticPublicFlags); + typeof(ClassOps).GetMethod(nameof(ClassOps.CallBaseCtor), staticPublicFlags, null, new Type[] { typeof(object), typeof(ConstructorInfo), typeof(object[]) }, null); internal static readonly MethodInfo ClassOps_CallMethodNonVirtually = - typeof(ClassOps).GetMethod(nameof(ClassOps.CallMethodNonVirtually), staticPublicFlags); + typeof(ClassOps).GetMethod(nameof(ClassOps.CallMethodNonVirtually), staticPublicFlags, null, new Type[] { typeof(object), typeof(MethodInfo), typeof(object[]) }, null); internal static readonly MethodInfo ClassOps_CallVoidMethodNonVirtually = - typeof(ClassOps).GetMethod(nameof(ClassOps.CallVoidMethodNonVirtually), staticPublicFlags); + typeof(ClassOps).GetMethod(nameof(ClassOps.CallVoidMethodNonVirtually), staticPublicFlags, null, new Type[] { typeof(object), typeof(MethodInfo), typeof(object[]) }, null); internal static readonly MethodInfo ArgumentTransformationAttribute_Transform = - typeof(ArgumentTransformationAttribute).GetMethod(nameof(ArgumentTransformationAttribute.Transform), instancePublicFlags); + typeof(ArgumentTransformationAttribute).GetMethod(nameof(ArgumentTransformationAttribute.Transform), instancePublicFlags, null, new Type[] { typeof(EngineIntrinsics), typeof(object) }, null); // ReSharper restore InconsistentNaming } From 3f46bcf9da18eb0b39bf688f7a94eb53cfcad323 Mon Sep 17 00:00:00 2001 From: Ilya Date: Fri, 8 Mar 2019 17:39:26 +0500 Subject: [PATCH 12/23] Revert "Step 11" This reverts commit 8058847b2414a3ada498d069ea05a2cc4507a689. --- .../engine/parser/Compiler.cs | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/System.Management.Automation/engine/parser/Compiler.cs b/src/System.Management.Automation/engine/parser/Compiler.cs index 166145beae6..1444c63b458 100644 --- a/src/System.Management.Automation/engine/parser/Compiler.cs +++ b/src/System.Management.Automation/engine/parser/Compiler.cs @@ -420,55 +420,55 @@ internal static class CachedReflectionInfo internal static readonly MethodInfo StringOps_FormatOperator = typeof(StringOps).GetMethod(nameof(StringOps.FormatOperator), staticFlags, null, CallingConventions.Standard, new Type[] { typeof(string), typeof(object) }, null); internal static readonly MethodInfo StringOps_Multiply = - typeof(StringOps).GetMethod(nameof(StringOps.Multiply), staticFlags, null, new Type[] { typeof(string), typeof(int) }, null); + typeof(StringOps).GetMethod(nameof(StringOps.Multiply), staticFlags); internal static readonly MethodInfo SwitchOps_ConditionSatisfiedRegex = - typeof(SwitchOps).GetMethod(nameof(SwitchOps.ConditionSatisfiedRegex), staticFlags, null, new Type[] { typeof(bool), typeof(object), typeof(IScriptExtent), typeof(string), typeof(ExecutionContext) }, null); + typeof(SwitchOps).GetMethod(nameof(SwitchOps.ConditionSatisfiedRegex), staticFlags); internal static readonly MethodInfo SwitchOps_ConditionSatisfiedWildcard = - typeof(SwitchOps).GetMethod(nameof(SwitchOps.ConditionSatisfiedWildcard), staticFlags, null, new Type[] { typeof(bool), typeof(object), typeof(string), typeof(ExecutionContext) }, null); + typeof(SwitchOps).GetMethod(nameof(SwitchOps.ConditionSatisfiedWildcard), staticFlags); internal static readonly MethodInfo SwitchOps_ResolveFilePath = - typeof(SwitchOps).GetMethod(nameof(SwitchOps.ResolveFilePath), staticFlags, null, new Type[] { typeof(IScriptExtent), typeof(object), typeof(ExecutionContext) }, null); + typeof(SwitchOps).GetMethod(nameof(SwitchOps.ResolveFilePath), staticFlags); internal static readonly MethodInfo TypeOps_AsOperator = - typeof(TypeOps).GetMethod(nameof(TypeOps.AsOperator), staticFlags, null, new Type[] { typeof(object), typeof(Type) }, null); + typeof(TypeOps).GetMethod(nameof(TypeOps.AsOperator), staticFlags); internal static readonly MethodInfo TypeOps_AddPowerShellTypesToTheScope = - typeof(TypeOps).GetMethod(nameof(TypeOps.AddPowerShellTypesToTheScope), staticFlags, null, new Type[] { typeof(Dictionary), typeof(ExecutionContext) }, null); + typeof(TypeOps).GetMethod(nameof(TypeOps.AddPowerShellTypesToTheScope), staticFlags); internal static readonly MethodInfo TypeOps_InitPowerShellTypesAtRuntime = - typeof(TypeOps).GetMethod(nameof(TypeOps.InitPowerShellTypesAtRuntime), staticFlags, null, new Type[] { typeof(TypeDefinitionAst[]) }, null); + typeof(TypeOps).GetMethod(nameof(TypeOps.InitPowerShellTypesAtRuntime), staticFlags); internal static readonly MethodInfo TypeOps_SetCurrentTypeResolutionState = - typeof(TypeOps).GetMethod(nameof(TypeOps.SetCurrentTypeResolutionState), staticFlags, null, new Type[] { typeof(TypeResolutionState), typeof(ExecutionContext) }, null); + typeof(TypeOps).GetMethod(nameof(TypeOps.SetCurrentTypeResolutionState), staticFlags); internal static readonly MethodInfo TypeOps_SetAssemblyDefiningPSTypes = - typeof(TypeOps).GetMethod(nameof(TypeOps.SetAssemblyDefiningPSTypes), staticFlags, null, new Type[] { typeof(FunctionContext), typeof(Assembly) }, null); + typeof(TypeOps).GetMethod(nameof(TypeOps.SetAssemblyDefiningPSTypes), staticFlags); internal static readonly MethodInfo TypeOps_IsInstance = - typeof(TypeOps).GetMethod(nameof(TypeOps.IsInstance), staticFlags, null, new Type[] { typeof(object), typeof(object) }, null); + typeof(TypeOps).GetMethod(nameof(TypeOps.IsInstance), staticFlags); internal static readonly MethodInfo TypeOps_ResolveTypeName = - typeof(TypeOps).GetMethod(nameof(TypeOps.ResolveTypeName), staticFlags, null, new Type[] { typeof(ITypeName), typeof(IScriptExtent) }, null); + typeof(TypeOps).GetMethod(nameof(TypeOps.ResolveTypeName), staticFlags); internal static readonly MethodInfo VariableOps_GetUsingValue = - typeof(VariableOps).GetMethod(nameof(VariableOps.GetUsingValue), staticFlags, null, new Type[] { typeof(MutableTuple), typeof(string), typeof(int), typeof(ExecutionContext) }, null); + typeof(VariableOps).GetMethod(nameof(VariableOps.GetUsingValue), staticFlags); internal static readonly MethodInfo VariableOps_GetVariableAsRef = - typeof(VariableOps).GetMethod(nameof(VariableOps.GetVariableAsRef), staticFlags, null, new Type[] { typeof(VariablePath), typeof(ExecutionContext), typeof(Type) }, null); + typeof(VariableOps).GetMethod(nameof(VariableOps.GetVariableAsRef), staticFlags); internal static readonly MethodInfo VariableOps_GetVariableValue = - typeof(VariableOps).GetMethod(nameof(VariableOps.GetVariableValue), staticFlags, null, new Type[] { typeof(VariablePath), typeof(ExecutionContext), typeof(VariableExpressionAst) }, null); + typeof(VariableOps).GetMethod(nameof(VariableOps.GetVariableValue), staticFlags); internal static readonly MethodInfo VariableOps_GetAutomaticVariableValue = - typeof(VariableOps).GetMethod(nameof(VariableOps.GetAutomaticVariableValue), staticFlags, null, new Type[] { typeof(int), typeof(ExecutionContext), typeof(VariableExpressionAst) }, null); + typeof(VariableOps).GetMethod(nameof(VariableOps.GetAutomaticVariableValue), staticFlags); internal static readonly MethodInfo VariableOps_SetVariableValue = - typeof(VariableOps).GetMethod(nameof(VariableOps.SetVariableValue), staticFlags, null, new Type[] { typeof(VariablePath), typeof(object), typeof(ExecutionContext), typeof(AttributeBaseAst[]) }, null); + typeof(VariableOps).GetMethod(nameof(VariableOps.SetVariableValue), staticFlags); internal static readonly MethodInfo Utils_IsComObject = - typeof(Utils).GetMethod(nameof(Utils.IsComObject), staticFlags, null, new Type[] { typeof(object) }, null); + typeof(Utils).GetMethod(nameof(Utils.IsComObject), staticFlags); internal static readonly MethodInfo ClassOps_ValidateSetProperty = - typeof(ClassOps).GetMethod(nameof(ClassOps.ValidateSetProperty), staticPublicFlags, null, new Type[] { typeof(Type), typeof(string), typeof(object) }, null); + typeof(ClassOps).GetMethod(nameof(ClassOps.ValidateSetProperty), staticPublicFlags); internal static readonly MethodInfo ClassOps_CallBaseCtor = - typeof(ClassOps).GetMethod(nameof(ClassOps.CallBaseCtor), staticPublicFlags, null, new Type[] { typeof(object), typeof(ConstructorInfo), typeof(object[]) }, null); + typeof(ClassOps).GetMethod(nameof(ClassOps.CallBaseCtor), staticPublicFlags); internal static readonly MethodInfo ClassOps_CallMethodNonVirtually = - typeof(ClassOps).GetMethod(nameof(ClassOps.CallMethodNonVirtually), staticPublicFlags, null, new Type[] { typeof(object), typeof(MethodInfo), typeof(object[]) }, null); + typeof(ClassOps).GetMethod(nameof(ClassOps.CallMethodNonVirtually), staticPublicFlags); internal static readonly MethodInfo ClassOps_CallVoidMethodNonVirtually = - typeof(ClassOps).GetMethod(nameof(ClassOps.CallVoidMethodNonVirtually), staticPublicFlags, null, new Type[] { typeof(object), typeof(MethodInfo), typeof(object[]) }, null); + typeof(ClassOps).GetMethod(nameof(ClassOps.CallVoidMethodNonVirtually), staticPublicFlags); internal static readonly MethodInfo ArgumentTransformationAttribute_Transform = - typeof(ArgumentTransformationAttribute).GetMethod(nameof(ArgumentTransformationAttribute.Transform), instancePublicFlags, null, new Type[] { typeof(EngineIntrinsics), typeof(object) }, null); + typeof(ArgumentTransformationAttribute).GetMethod(nameof(ArgumentTransformationAttribute.Transform), instancePublicFlags); // ReSharper restore InconsistentNaming } From ad168223b147182bf3a35bca80d27efebb0aaff5 Mon Sep 17 00:00:00 2001 From: Ilya Date: Fri, 8 Mar 2019 17:39:43 +0500 Subject: [PATCH 13/23] Revert "Step 10" This reverts commit 0a8f4c0062b37d70f6296426597b16c276851a76. --- .../engine/parser/Compiler.cs | 33 +++++++++++-------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/src/System.Management.Automation/engine/parser/Compiler.cs b/src/System.Management.Automation/engine/parser/Compiler.cs index 1444c63b458..16b520e433b 100644 --- a/src/System.Management.Automation/engine/parser/Compiler.cs +++ b/src/System.Management.Automation/engine/parser/Compiler.cs @@ -376,12 +376,12 @@ internal static class CachedReflectionInfo typeof(ReservedNameMembers).GetMethod(nameof(ReservedNameMembers.PSTypeNames), new Type[] { typeof(PSObject) }); internal static readonly MethodInfo RestrictedLanguageChecker_CheckDataStatementLanguageModeAtRuntime = - typeof(RestrictedLanguageChecker).GetMethod(nameof(RestrictedLanguageChecker.CheckDataStatementLanguageModeAtRuntime), staticFlags, null, new Type[] { typeof(DataStatementAst), typeof(ExecutionContext) }, null); + typeof(RestrictedLanguageChecker).GetMethod(nameof(RestrictedLanguageChecker.CheckDataStatementLanguageModeAtRuntime), staticFlags); internal static readonly MethodInfo RestrictedLanguageChecker_CheckDataStatementAstAtRuntime = - typeof(RestrictedLanguageChecker).GetMethod(nameof(RestrictedLanguageChecker.CheckDataStatementAstAtRuntime), staticFlags, null, new Type[] { typeof(DataStatementAst), typeof(string[]) }, null); + typeof(RestrictedLanguageChecker).GetMethod(nameof(RestrictedLanguageChecker.CheckDataStatementAstAtRuntime), staticFlags); internal static readonly MethodInfo RestrictedLanguageChecker_EnsureUtilityModuleLoaded = - typeof(RestrictedLanguageChecker).GetMethod(nameof(RestrictedLanguageChecker.EnsureUtilityModuleLoaded), staticFlags, null, new Type[] { typeof(ExecutionContext) }, null); + typeof(RestrictedLanguageChecker).GetMethod(nameof(RestrictedLanguageChecker.EnsureUtilityModuleLoaded), staticFlags); internal static readonly ConstructorInfo ReturnException_ctor = typeof(ReturnException).GetConstructor(instanceFlags, null, CallingConventions.Standard, new Type[] { typeof(object) }, null); @@ -390,35 +390,40 @@ internal static class CachedReflectionInfo typeof(RuntimeException).GetProperty(nameof(RuntimeException.ErrorRecord)); internal static readonly MethodInfo ScriptBlock_DoInvokeReturnAsIs = - typeof(ScriptBlock).GetMethod(nameof(ScriptBlock.DoInvokeReturnAsIs), instanceFlags, null, new Type[] { typeof(bool), typeof(ScriptBlock.ErrorHandlingBehavior), typeof(object), typeof(object), typeof(object), typeof(object[]) }, null); + typeof(ScriptBlock).GetMethod(nameof(ScriptBlock.DoInvokeReturnAsIs), instanceFlags); internal static readonly MethodInfo ScriptBlock_InvokeAsDelegateHelper = - typeof(ScriptBlock).GetMethod(nameof(ScriptBlock.InvokeAsDelegateHelper), instanceFlags, null, new Type[] { typeof(object), typeof(object), typeof(object[]) }, null); + typeof(ScriptBlock).GetMethod(nameof(ScriptBlock.InvokeAsDelegateHelper), instanceFlags); internal static readonly MethodInfo ScriptBlockExpressionWrapper_GetScriptBlock = - typeof(ScriptBlockExpressionWrapper).GetMethod(nameof(ScriptBlockExpressionWrapper.GetScriptBlock), instanceFlags, null, new Type[] { typeof(ExecutionContext), typeof(bool) }, null); + typeof(ScriptBlockExpressionWrapper).GetMethod(nameof(ScriptBlockExpressionWrapper.GetScriptBlock), instanceFlags); internal static readonly ConstructorInfo SetValueException_ctor = - typeof(SetValueException).GetConstructor(instanceFlags, null, new[] { typeof(string), typeof(Exception), typeof(string), typeof(object[]) }, null); + typeof(SetValueException).GetConstructor(instanceFlags, null, + new[] { typeof(string), typeof(Exception), typeof(string), typeof(object[]) }, null); internal static readonly ConstructorInfo GetValueException_ctor = - typeof(GetValueException).GetConstructor(instanceFlags, null, new[] { typeof(string), typeof(Exception), typeof(string), typeof(object[]) }, null); + typeof(GetValueException).GetConstructor(instanceFlags, null, + new[] { typeof(string), typeof(Exception), typeof(string), typeof(object[]) }, null); internal static readonly ConstructorInfo StreamReader_ctor = typeof(StreamReader).GetConstructor(new Type[] { typeof(string) }); internal static readonly MethodInfo StreamReader_ReadLine = - typeof(StreamReader).GetMethod(nameof(StreamReader.ReadLine), Type.EmptyTypes); + typeof(StreamReader).GetMethod(nameof(StreamReader.ReadLine)); internal static readonly ConstructorInfo String_ctor_char_int = typeof(string).GetConstructor(new Type[] { typeof(char), typeof(int) }); internal static readonly MethodInfo String_Concat_String = - typeof(string).GetMethod(nameof(string.Concat), staticPublicFlags, null, CallingConventions.Standard, new Type[] { typeof(string), typeof(string) }, null); + typeof(string).GetMethod(nameof(string.Concat), staticPublicFlags, null, + CallingConventions.Standard, new Type[] { typeof(string), typeof(string) }, null); internal static readonly MethodInfo String_Equals = - typeof(string).GetMethod(nameof(string.Equals), staticPublicFlags, null, CallingConventions.Standard, new Type[] { typeof(string), typeof(string), typeof(StringComparison) }, null); + typeof(string).GetMethod(nameof(string.Equals), staticPublicFlags, null, + CallingConventions.Standard, + new Type[] { typeof(string), typeof(string), typeof(StringComparison) }, null); internal static readonly MethodInfo StringOps_Compare = - typeof(StringOps).GetMethod(nameof(StringOps.Compare), staticFlags, null, CallingConventions.Standard, new Type[] { typeof(string), typeof(string), typeof(CultureInfo), typeof(CompareOptions) }, null); + typeof(StringOps).GetMethod(nameof(StringOps.Compare), staticFlags); internal static readonly MethodInfo StringOps_Equals = - typeof(StringOps).GetMethod(nameof(StringOps.Equals), staticFlags, null, CallingConventions.Standard, new Type[] { typeof(string), typeof(string), typeof(CultureInfo), typeof(CompareOptions) }, null); + typeof(StringOps).GetMethod(nameof(StringOps.Equals), staticFlags); internal static readonly MethodInfo StringOps_FormatOperator = - typeof(StringOps).GetMethod(nameof(StringOps.FormatOperator), staticFlags, null, CallingConventions.Standard, new Type[] { typeof(string), typeof(object) }, null); + typeof(StringOps).GetMethod(nameof(StringOps.FormatOperator), staticFlags); internal static readonly MethodInfo StringOps_Multiply = typeof(StringOps).GetMethod(nameof(StringOps.Multiply), staticFlags); From ee7cc08be676ea286ccfceb5a94acb47a8da08f3 Mon Sep 17 00:00:00 2001 From: Ilya Date: Fri, 8 Mar 2019 17:39:47 +0500 Subject: [PATCH 14/23] Revert "Step 9" This reverts commit 3f910c21689a61ca2eabe20eec853c18567a0cf4. --- .../engine/parser/Compiler.cs | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/System.Management.Automation/engine/parser/Compiler.cs b/src/System.Management.Automation/engine/parser/Compiler.cs index 16b520e433b..c77548e7dc6 100644 --- a/src/System.Management.Automation/engine/parser/Compiler.cs +++ b/src/System.Management.Automation/engine/parser/Compiler.cs @@ -308,9 +308,9 @@ internal static class CachedReflectionInfo internal static readonly MethodInfo PSGetMemberBinder_TryGetGenericDictionaryValue = typeof(PSGetMemberBinder).GetMethod(nameof(PSGetMemberBinder.TryGetGenericDictionaryValue), staticFlags); internal static readonly MethodInfo PSGetMemberBinder_TryGetInstanceMember = - typeof(PSGetMemberBinder).GetMethod(nameof(PSGetMemberBinder.TryGetInstanceMember), staticFlags); + typeof(PSGetMemberBinder).GetMethod(nameof(PSGetMemberBinder.TryGetInstanceMember), staticFlags, null, new Type[] { typeof(object), typeof(string), typeof(MemberInfo) }, null); internal static readonly MethodInfo PSGetMemberBinder_TryGetIDictionaryValue = - typeof(PSGetMemberBinder).GetMethod(nameof(PSGetMemberBinder.TryGetIDictionaryValue), staticFlags); + typeof(PSGetMemberBinder).GetMethod(nameof(PSGetMemberBinder.TryGetIDictionaryValue), staticFlags, null, new Type[] { typeof(IDictionary), typeof(string), typeof(object) }, null); internal static readonly MethodInfo PSInvokeMemberBinder_InvokeAdaptedMember = typeof(PSInvokeMemberBinder).GetMethod(nameof(PSInvokeMemberBinder.InvokeAdaptedMember), staticFlags, null, new Type[] { typeof(object), typeof(string), typeof(object[]) }, null); @@ -321,7 +321,7 @@ internal static class CachedReflectionInfo internal static readonly MethodInfo PSInvokeMemberBinder_IsHomogenousArray = typeof(PSInvokeMemberBinder).GetMethod(nameof(PSInvokeMemberBinder.IsHomogenousArray), staticFlags, null, new Type[] { typeof(object[]) }, null); internal static readonly MethodInfo PSInvokeMemberBinder_TryGetInstanceMethod = - typeof(PSInvokeMemberBinder).GetMethod(nameof(PSInvokeMemberBinder.TryGetInstanceMethod), staticFlags); + typeof(PSInvokeMemberBinder).GetMethod(nameof(PSInvokeMemberBinder.TryGetInstanceMethod), staticFlags, null, new Type[] { typeof(object), typeof(string), typeof(PSMethodInfo) }, null); internal static readonly MethodInfo PSMethodInfo_Invoke = typeof(PSMethodInfo).GetMethod(nameof(PSMethodInfo.Invoke)); @@ -342,15 +342,15 @@ internal static class CachedReflectionInfo typeof(PSReference).GetProperty(nameof(PSReference.Value)); internal static readonly MethodInfo PSScriptMethod_InvokeScript = - typeof(PSScriptMethod).GetMethod(nameof(PSScriptMethod.InvokeScript), staticFlags, null, new Type[] { typeof(string), typeof(ScriptBlock), typeof(object), typeof(object[]) }, null); + typeof(PSScriptMethod).GetMethod(nameof(PSScriptMethod.InvokeScript), staticFlags); internal static readonly MethodInfo PSScriptProperty_InvokeGetter = - typeof(PSScriptProperty).GetMethod(nameof(PSScriptProperty.InvokeGetter), instanceFlags, null, new Type[] { typeof(object) }, null); + typeof(PSScriptProperty).GetMethod(nameof(PSScriptProperty.InvokeGetter), instanceFlags); internal static readonly MethodInfo PSScriptProperty_InvokeSetter = - typeof(PSScriptProperty).GetMethod(nameof(PSScriptProperty.InvokeSetter), instanceFlags, null, new Type[] { typeof(object), typeof(object) }, null); + typeof(PSScriptProperty).GetMethod(nameof(PSScriptProperty.InvokeSetter), instanceFlags); internal static readonly MethodInfo PSSetMemberBinder_SetAdaptedValue = - typeof(PSSetMemberBinder).GetMethod(nameof(PSSetMemberBinder.SetAdaptedValue), staticFlags, null, new Type[] { typeof(object), typeof(string), typeof(object) }, null); + typeof(PSSetMemberBinder).GetMethod(nameof(PSSetMemberBinder.SetAdaptedValue), staticFlags); internal static readonly MethodInfo PSVariableAssignmentBinder_CopyInstanceMembersOfValueType = typeof(PSVariableAssignmentBinder).GetMethod(nameof(PSVariableAssignmentBinder.CopyInstanceMembersOfValueType), staticFlags); @@ -358,22 +358,22 @@ internal static class CachedReflectionInfo typeof(PSVariableAssignmentBinder).GetField(nameof(PSVariableAssignmentBinder.s_mutableValueWithInstanceMemberVersion), staticFlags); internal static readonly MethodInfo PSCreateInstanceBinder_IsTargetTypeNonPublic = - typeof(PSCreateInstanceBinder).GetMethod(nameof(PSCreateInstanceBinder.IsTargetTypeNonPublic), staticFlags, null, new Type[] { typeof(object) }, null); + typeof(PSCreateInstanceBinder).GetMethod(nameof(PSCreateInstanceBinder.IsTargetTypeNonPublic), staticFlags); internal static readonly MethodInfo PSCreateInstanceBinder_IsTargetTypeByRefLike = - typeof(PSCreateInstanceBinder).GetMethod(nameof(PSCreateInstanceBinder.IsTargetTypeByRefLike), staticFlags, null, new Type[] { typeof(object) }, null); + typeof(PSCreateInstanceBinder).GetMethod(nameof(PSCreateInstanceBinder.IsTargetTypeByRefLike), staticFlags); internal static readonly MethodInfo PSCreateInstanceBinder_GetTargetTypeName = - typeof(PSCreateInstanceBinder).GetMethod(nameof(PSCreateInstanceBinder.GetTargetTypeName), staticFlags, null, new Type[] { typeof(object) }, null); + typeof(PSCreateInstanceBinder).GetMethod(nameof(PSCreateInstanceBinder.GetTargetTypeName), staticFlags); internal static readonly MethodInfo ReservedNameMembers_GeneratePSAdaptedMemberSet = - typeof(ReservedNameMembers).GetMethod(nameof(ReservedNameMembers.GeneratePSAdaptedMemberSet), staticFlags, null, new Type[] { typeof(object) }, null); + typeof(ReservedNameMembers).GetMethod(nameof(ReservedNameMembers.GeneratePSAdaptedMemberSet), staticFlags); internal static readonly MethodInfo ReservedNameMembers_GeneratePSBaseMemberSet = - typeof(ReservedNameMembers).GetMethod(nameof(ReservedNameMembers.GeneratePSBaseMemberSet), staticFlags, null, new Type[] { typeof(object) }, null); + typeof(ReservedNameMembers).GetMethod(nameof(ReservedNameMembers.GeneratePSBaseMemberSet), staticFlags); internal static readonly MethodInfo ReservedNameMembers_GeneratePSExtendedMemberSet = - typeof(ReservedNameMembers).GetMethod(nameof(ReservedNameMembers.GeneratePSExtendedMemberSet), staticFlags, null, new Type[] { typeof(object) }, null); + typeof(ReservedNameMembers).GetMethod(nameof(ReservedNameMembers.GeneratePSExtendedMemberSet), staticFlags); internal static readonly MethodInfo ReservedNameMembers_GeneratePSObjectMemberSet = - typeof(ReservedNameMembers).GetMethod(nameof(ReservedNameMembers.GeneratePSObjectMemberSet), staticFlags, null, new Type[] { typeof(object) }, null); + typeof(ReservedNameMembers).GetMethod(nameof(ReservedNameMembers.GeneratePSObjectMemberSet), staticFlags); internal static readonly MethodInfo ReservedNameMembers_PSTypeNames = - typeof(ReservedNameMembers).GetMethod(nameof(ReservedNameMembers.PSTypeNames), new Type[] { typeof(PSObject) }); + typeof(ReservedNameMembers).GetMethod(nameof(ReservedNameMembers.PSTypeNames)); internal static readonly MethodInfo RestrictedLanguageChecker_CheckDataStatementLanguageModeAtRuntime = typeof(RestrictedLanguageChecker).GetMethod(nameof(RestrictedLanguageChecker.CheckDataStatementLanguageModeAtRuntime), staticFlags); From d1df1572a244b0049233f1f657f698137f1f9b02 Mon Sep 17 00:00:00 2001 From: Ilya Date: Fri, 8 Mar 2019 17:39:50 +0500 Subject: [PATCH 15/23] Revert "Step 8" This reverts commit 22472fa289ca6ac6948c860db41e42e2376d6bac. --- .../engine/parser/Compiler.cs | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/System.Management.Automation/engine/parser/Compiler.cs b/src/System.Management.Automation/engine/parser/Compiler.cs index c77548e7dc6..b1cf6a9b218 100644 --- a/src/System.Management.Automation/engine/parser/Compiler.cs +++ b/src/System.Management.Automation/engine/parser/Compiler.cs @@ -295,33 +295,33 @@ internal static class CachedReflectionInfo typeof(PipelineOps).GetMethod(nameof(PipelineOps.ClearPipe), staticFlags, null, new Type[] { typeof(List) }, null); internal static readonly MethodInfo PSGetDynamicMemberBinder_GetIDictionaryMember = - typeof(PSGetDynamicMemberBinder).GetMethod(nameof(PSGetDynamicMemberBinder.GetIDictionaryMember), staticFlags, null, new Type[] { typeof(IDictionary), typeof(object) }, null); + typeof(PSGetDynamicMemberBinder).GetMethod(nameof(PSGetDynamicMemberBinder.GetIDictionaryMember), staticFlags); internal static readonly MethodInfo PSGetMemberBinder_CloneMemberInfo = - typeof(PSGetMemberBinder).GetMethod(nameof(PSGetMemberBinder.CloneMemberInfo), staticFlags, null, new Type[] { typeof(PSMemberInfo), typeof(object) }, null); + typeof(PSGetMemberBinder).GetMethod(nameof(PSGetMemberBinder.CloneMemberInfo), staticFlags); internal static readonly MethodInfo PSGetMemberBinder_GetAdaptedValue = - typeof(PSGetMemberBinder).GetMethod(nameof(PSGetMemberBinder.GetAdaptedValue), staticFlags, null, new Type[] { typeof(object), typeof(string) }, null); + typeof(PSGetMemberBinder).GetMethod(nameof(PSGetMemberBinder.GetAdaptedValue), staticFlags); internal static readonly MethodInfo PSGetMemberBinder_GetTypeTableFromTLS = - typeof(PSGetMemberBinder).GetMethod(nameof(PSGetMemberBinder.GetTypeTableFromTLS), staticFlags, null, Type.EmptyTypes, null); + typeof(PSGetMemberBinder).GetMethod(nameof(PSGetMemberBinder.GetTypeTableFromTLS), staticFlags); internal static readonly MethodInfo PSGetMemberBinder_IsTypeNameSame = - typeof(PSGetMemberBinder).GetMethod(nameof(PSGetMemberBinder.IsTypeNameSame), staticFlags, null, new Type[] { typeof(object), typeof(string) }, null); + typeof(PSGetMemberBinder).GetMethod(nameof(PSGetMemberBinder.IsTypeNameSame), staticFlags); internal static readonly MethodInfo PSGetMemberBinder_TryGetGenericDictionaryValue = typeof(PSGetMemberBinder).GetMethod(nameof(PSGetMemberBinder.TryGetGenericDictionaryValue), staticFlags); internal static readonly MethodInfo PSGetMemberBinder_TryGetInstanceMember = - typeof(PSGetMemberBinder).GetMethod(nameof(PSGetMemberBinder.TryGetInstanceMember), staticFlags, null, new Type[] { typeof(object), typeof(string), typeof(MemberInfo) }, null); + typeof(PSGetMemberBinder).GetMethod(nameof(PSGetMemberBinder.TryGetInstanceMember), staticFlags); internal static readonly MethodInfo PSGetMemberBinder_TryGetIDictionaryValue = - typeof(PSGetMemberBinder).GetMethod(nameof(PSGetMemberBinder.TryGetIDictionaryValue), staticFlags, null, new Type[] { typeof(IDictionary), typeof(string), typeof(object) }, null); + typeof(PSGetMemberBinder).GetMethod(nameof(PSGetMemberBinder.TryGetIDictionaryValue), staticFlags); internal static readonly MethodInfo PSInvokeMemberBinder_InvokeAdaptedMember = - typeof(PSInvokeMemberBinder).GetMethod(nameof(PSInvokeMemberBinder.InvokeAdaptedMember), staticFlags, null, new Type[] { typeof(object), typeof(string), typeof(object[]) }, null); + typeof(PSInvokeMemberBinder).GetMethod(nameof(PSInvokeMemberBinder.InvokeAdaptedMember), staticFlags); internal static readonly MethodInfo PSInvokeMemberBinder_InvokeAdaptedSetMember = - typeof(PSInvokeMemberBinder).GetMethod(nameof(PSInvokeMemberBinder.InvokeAdaptedSetMember), staticFlags, null, new Type[] { typeof(object), typeof(string), typeof(object[]), typeof(object) }, null); + typeof(PSInvokeMemberBinder).GetMethod(nameof(PSInvokeMemberBinder.InvokeAdaptedSetMember), staticFlags); internal static readonly MethodInfo PSInvokeMemberBinder_IsHeterogeneousArray = - typeof(PSInvokeMemberBinder).GetMethod(nameof(PSInvokeMemberBinder.IsHeterogeneousArray), staticFlags, null, new Type[] { typeof(object[]) }, null); + typeof(PSInvokeMemberBinder).GetMethod(nameof(PSInvokeMemberBinder.IsHeterogeneousArray), staticFlags); internal static readonly MethodInfo PSInvokeMemberBinder_IsHomogenousArray = - typeof(PSInvokeMemberBinder).GetMethod(nameof(PSInvokeMemberBinder.IsHomogenousArray), staticFlags, null, new Type[] { typeof(object[]) }, null); + typeof(PSInvokeMemberBinder).GetMethod(nameof(PSInvokeMemberBinder.IsHomogenousArray), staticFlags); internal static readonly MethodInfo PSInvokeMemberBinder_TryGetInstanceMethod = - typeof(PSInvokeMemberBinder).GetMethod(nameof(PSInvokeMemberBinder.TryGetInstanceMethod), staticFlags, null, new Type[] { typeof(object), typeof(string), typeof(PSMethodInfo) }, null); + typeof(PSInvokeMemberBinder).GetMethod(nameof(PSInvokeMemberBinder.TryGetInstanceMethod), staticFlags); internal static readonly MethodInfo PSMethodInfo_Invoke = typeof(PSMethodInfo).GetMethod(nameof(PSMethodInfo.Invoke)); From f9946d3c80e94cb79faad780de099c3e7649c1c9 Mon Sep 17 00:00:00 2001 From: Ilya Date: Fri, 8 Mar 2019 17:39:54 +0500 Subject: [PATCH 16/23] Revert "Step 7" This reverts commit e7766b1de6f1b5dc0ffa6bb2a87c08fb90a2d443. --- .../engine/parser/Compiler.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/System.Management.Automation/engine/parser/Compiler.cs b/src/System.Management.Automation/engine/parser/Compiler.cs index b1cf6a9b218..a7c282ee2d2 100644 --- a/src/System.Management.Automation/engine/parser/Compiler.cs +++ b/src/System.Management.Automation/engine/parser/Compiler.cs @@ -282,17 +282,17 @@ internal static class CachedReflectionInfo internal static readonly MethodInfo PipelineOps_GetExitException = typeof(PipelineOps).GetMethod(nameof(PipelineOps.GetExitException), staticFlags, null, new Type[] { typeof(object) }, null); internal static readonly MethodInfo PipelineOps_FlushPipe = - typeof(PipelineOps).GetMethod(nameof(PipelineOps.FlushPipe), staticFlags, null, new Type[] { typeof(Pipe), typeof(List) }, null); + typeof(PipelineOps).GetMethod(nameof(PipelineOps.FlushPipe), staticFlags); internal static readonly MethodInfo PipelineOps_InvokePipeline = - typeof(PipelineOps).GetMethod(nameof(PipelineOps.InvokePipeline), staticFlags, null, new Type[] { typeof(object), typeof(bool), typeof(CommandParameterInternal[][]), typeof(CommandBaseAst[]), typeof(CommandRedirection[][]), typeof(FunctionContext) }, null); + typeof(PipelineOps).GetMethod(nameof(PipelineOps.InvokePipeline), staticFlags); internal static readonly MethodInfo PipelineOps_InvokePipelineInBackground = - typeof(PipelineOps).GetMethod(nameof(PipelineOps.InvokePipelineInBackground), staticFlags, null, new Type[] { typeof(PipelineAst), typeof(FunctionContext) }, null); + typeof(PipelineOps).GetMethod(nameof(PipelineOps.InvokePipelineInBackground), staticFlags); internal static readonly MethodInfo PipelineOps_Nop = typeof(PipelineOps).GetMethod(nameof(PipelineOps.Nop), staticFlags, null, Type.EmptyTypes, null); internal static readonly MethodInfo PipelineOps_PipelineResult = - typeof(PipelineOps).GetMethod(nameof(PipelineOps.PipelineResult), staticFlags, null, new Type[] { typeof(List) }, null); + typeof(PipelineOps).GetMethod(nameof(PipelineOps.PipelineResult), staticFlags); internal static readonly MethodInfo PipelineOps_ClearPipe = - typeof(PipelineOps).GetMethod(nameof(PipelineOps.ClearPipe), staticFlags, null, new Type[] { typeof(List) }, null); + typeof(PipelineOps).GetMethod(nameof(PipelineOps.ClearPipe), staticFlags); internal static readonly MethodInfo PSGetDynamicMemberBinder_GetIDictionaryMember = typeof(PSGetDynamicMemberBinder).GetMethod(nameof(PSGetDynamicMemberBinder.GetIDictionaryMember), staticFlags); From 56282b2a911a0e712cd9f7129145a3b067f5a5fb Mon Sep 17 00:00:00 2001 From: Ilya Date: Fri, 8 Mar 2019 17:39:57 +0500 Subject: [PATCH 17/23] Revert "Step 6" This reverts commit 0197507eb77d5a762221dd4f3ba310aaecac855f. --- .../engine/parser/Compiler.cs | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/System.Management.Automation/engine/parser/Compiler.cs b/src/System.Management.Automation/engine/parser/Compiler.cs index a7c282ee2d2..53105429f34 100644 --- a/src/System.Management.Automation/engine/parser/Compiler.cs +++ b/src/System.Management.Automation/engine/parser/Compiler.cs @@ -252,35 +252,35 @@ internal static class CachedReflectionInfo internal static readonly MethodInfo ParserOps_LikeOperator = typeof(ParserOps).GetMethod(nameof(ParserOps.LikeOperator), staticFlags, null, new Type[] { typeof(ExecutionContext), typeof(IScriptExtent), typeof(object), typeof(object), typeof(TokenKind) }, null); internal static readonly MethodInfo ParserOps_MatchOperator = - typeof(ParserOps).GetMethod(nameof(ParserOps.MatchOperator), staticFlags, null, new Type[] { typeof(ExecutionContext), typeof(IScriptExtent), typeof(object), typeof(object), typeof(bool), typeof(bool) }, null); + typeof(ParserOps).GetMethod(nameof(ParserOps.MatchOperator), staticFlags); internal static readonly MethodInfo ParserOps_RangeOperator = - typeof(ParserOps).GetMethod(nameof(ParserOps.RangeOperator), staticFlags, null, new Type[] { typeof(object), typeof(object) }, null); + typeof(ParserOps).GetMethod(nameof(ParserOps.RangeOperator), staticFlags); internal static readonly MethodInfo ParserOps_GetRangeEnumerator = - typeof(ParserOps).GetMethod(nameof(ParserOps.GetRangeEnumerator), staticFlags, null, new Type[] { typeof(object), typeof(object) }, null); + typeof(ParserOps).GetMethod(nameof(ParserOps.GetRangeEnumerator), staticFlags); internal static readonly MethodInfo ParserOps_ReplaceOperator = - typeof(ParserOps).GetMethod(nameof(ParserOps.ReplaceOperator), staticFlags, null, new Type[] { typeof(ExecutionContext), typeof(IScriptExtent), typeof(object), typeof(object), typeof(bool) }, null); + typeof(ParserOps).GetMethod(nameof(ParserOps.ReplaceOperator), staticFlags); internal static readonly MethodInfo ParserOps_SplitOperator = - typeof(ParserOps).GetMethod(nameof(ParserOps.SplitOperator), staticFlags, null, new Type[] { typeof(ExecutionContext), typeof(IScriptExtent), typeof(object), typeof(object), typeof(bool) }, null); + typeof(ParserOps).GetMethod(nameof(ParserOps.SplitOperator), staticFlags); internal static readonly MethodInfo ParserOps_UnaryJoinOperator = - typeof(ParserOps).GetMethod(nameof(ParserOps.UnaryJoinOperator), staticFlags, null, new Type[] { typeof(ExecutionContext), typeof(IScriptExtent), typeof(object) }, null); + typeof(ParserOps).GetMethod(nameof(ParserOps.UnaryJoinOperator), staticFlags); internal static readonly MethodInfo ParserOps_UnarySplitOperator = - typeof(ParserOps).GetMethod(nameof(ParserOps.UnarySplitOperator), staticFlags, null, new Type[] { typeof(ExecutionContext), typeof(IScriptExtent), typeof(object) }, null); + typeof(ParserOps).GetMethod(nameof(ParserOps.UnarySplitOperator), staticFlags); internal static readonly ConstructorInfo Pipe_ctor = typeof(Pipe).GetConstructor(instanceFlags, null, CallingConventions.Standard, new Type[] { typeof(List) }, null); internal static readonly MethodInfo Pipe_Add = - typeof(Pipe).GetMethod(nameof(Pipe.Add), instanceFlags, null, new Type[] { typeof(object) }, null); + typeof(Pipe).GetMethod(nameof(Pipe.Add), instanceFlags); internal static readonly MethodInfo Pipe_SetVariableListForTemporaryPipe = - typeof(Pipe).GetMethod(nameof(Pipe.SetVariableListForTemporaryPipe), instanceFlags, null, new Type[] { typeof(Pipe) }, null); + typeof(Pipe).GetMethod(nameof(Pipe.SetVariableListForTemporaryPipe), instanceFlags); internal static readonly MethodInfo PipelineOps_CheckAutomationNullInCommandArgument = - typeof(PipelineOps).GetMethod(nameof(PipelineOps.CheckAutomationNullInCommandArgument), staticFlags, null, new Type[] { typeof(object) }, null); + typeof(PipelineOps).GetMethod(nameof(PipelineOps.CheckAutomationNullInCommandArgument), staticFlags); internal static readonly MethodInfo PipelineOps_CheckAutomationNullInCommandArgumentArray = - typeof(PipelineOps).GetMethod(nameof(PipelineOps.CheckAutomationNullInCommandArgumentArray), staticFlags, null, new Type[] { typeof(object[]) }, null); + typeof(PipelineOps).GetMethod(nameof(PipelineOps.CheckAutomationNullInCommandArgumentArray), staticFlags); internal static readonly MethodInfo PipelineOps_CheckForInterrupts = - typeof(PipelineOps).GetMethod(nameof(PipelineOps.CheckForInterrupts), staticFlags, null, new Type[] { typeof(ExecutionContext) }, null); + typeof(PipelineOps).GetMethod(nameof(PipelineOps.CheckForInterrupts), staticFlags); internal static readonly MethodInfo PipelineOps_GetExitException = - typeof(PipelineOps).GetMethod(nameof(PipelineOps.GetExitException), staticFlags, null, new Type[] { typeof(object) }, null); + typeof(PipelineOps).GetMethod(nameof(PipelineOps.GetExitException), staticFlags); internal static readonly MethodInfo PipelineOps_FlushPipe = typeof(PipelineOps).GetMethod(nameof(PipelineOps.FlushPipe), staticFlags); internal static readonly MethodInfo PipelineOps_InvokePipeline = @@ -288,7 +288,7 @@ internal static class CachedReflectionInfo internal static readonly MethodInfo PipelineOps_InvokePipelineInBackground = typeof(PipelineOps).GetMethod(nameof(PipelineOps.InvokePipelineInBackground), staticFlags); internal static readonly MethodInfo PipelineOps_Nop = - typeof(PipelineOps).GetMethod(nameof(PipelineOps.Nop), staticFlags, null, Type.EmptyTypes, null); + typeof(PipelineOps).GetMethod(nameof(PipelineOps.Nop), staticFlags); internal static readonly MethodInfo PipelineOps_PipelineResult = typeof(PipelineOps).GetMethod(nameof(PipelineOps.PipelineResult), staticFlags); internal static readonly MethodInfo PipelineOps_ClearPipe = From 22e08be4e94fcb237a07b4596e3abc1f24d2b1dd Mon Sep 17 00:00:00 2001 From: Ilya Date: Fri, 8 Mar 2019 17:40:00 +0500 Subject: [PATCH 18/23] Revert "Step 5" This reverts commit 75e7d557061906b8e0e1471f2616cce41fe84d4d. --- .../engine/parser/Compiler.cs | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/src/System.Management.Automation/engine/parser/Compiler.cs b/src/System.Management.Automation/engine/parser/Compiler.cs index 53105429f34..d65404daaf6 100644 --- a/src/System.Management.Automation/engine/parser/Compiler.cs +++ b/src/System.Management.Automation/engine/parser/Compiler.cs @@ -193,18 +193,18 @@ internal static class CachedReflectionInfo typeof(ICollection).GetProperty(nameof(ICollection.Count)); internal static readonly MethodInfo IComparable_CompareTo = - typeof(IComparable).GetMethod(nameof(IComparable.CompareTo), new Type[] { typeof(object) }); + typeof(IComparable).GetMethod(nameof(IComparable.CompareTo)); internal static readonly MethodInfo IDisposable_Dispose = - typeof(IDisposable).GetMethod(nameof(IDisposable.Dispose), Type.EmptyTypes); + typeof(IDisposable).GetMethod(nameof(IDisposable.Dispose)); internal static readonly MethodInfo IEnumerable_GetEnumerator = - typeof(IEnumerable).GetMethod(nameof(IEnumerable.GetEnumerator), Type.EmptyTypes); + typeof(IEnumerable).GetMethod(nameof(IEnumerable.GetEnumerator)); internal static readonly PropertyInfo IEnumerator_Current = typeof(IEnumerator).GetProperty(nameof(IEnumerator.Current)); internal static readonly MethodInfo IEnumerator_MoveNext = - typeof(IEnumerator).GetMethod(nameof(IEnumerator.MoveNext), Type.EmptyTypes); + typeof(IEnumerator).GetMethod(nameof(IEnumerator.MoveNext)); internal static readonly MethodInfo IList_get_Item = typeof(IList).GetMethod("get_Item"); @@ -215,42 +215,44 @@ internal static class CachedReflectionInfo typeof(InterpreterError).GetMethod(nameof(InterpreterError.NewInterpreterExceptionWithInnerException), staticFlags); internal static readonly MethodInfo LanguagePrimitives_GetInvalidCastMessages = - typeof(LanguagePrimitives).GetMethod(nameof(LanguagePrimitives.GetInvalidCastMessages), staticFlags, null, new Type[] { typeof(object), typeof(Type) }, null); + typeof(LanguagePrimitives).GetMethod(nameof(LanguagePrimitives.GetInvalidCastMessages), staticFlags); internal static readonly MethodInfo LanguagePrimitives_ThrowInvalidCastException = - typeof(LanguagePrimitives).GetMethod(nameof(LanguagePrimitives.ThrowInvalidCastException), staticFlags, null, new Type[] { typeof(object), typeof(Type) }, null); + typeof(LanguagePrimitives).GetMethod(nameof(LanguagePrimitives.ThrowInvalidCastException), staticFlags); internal static readonly MethodInfo LocalPipeline_GetExecutionContextFromTLS = - typeof(LocalPipeline).GetMethod(nameof(LocalPipeline.GetExecutionContextFromTLS), staticFlags, null, Type.EmptyTypes, null); + typeof(LocalPipeline).GetMethod(nameof(LocalPipeline.GetExecutionContextFromTLS), staticFlags); internal static readonly MethodInfo LoopFlowException_MatchLabel = - typeof(LoopFlowException).GetMethod(nameof(LoopFlowException.MatchLabel), instanceFlags, null, new Type[] { typeof(string) }, null); + typeof(LoopFlowException).GetMethod(nameof(LoopFlowException.MatchLabel), instanceFlags); internal static readonly MethodInfo MergingRedirection_BindForExpression = - typeof(MergingRedirection).GetMethod(nameof(MergingRedirection.BindForExpression), instanceFlags, null, new Type[] { typeof(ExecutionContext), typeof(FunctionContext) }, null); + typeof(MergingRedirection).GetMethod(nameof(MergingRedirection.BindForExpression), instanceFlags); internal static readonly ConstructorInfo MethodException_ctor = - typeof(MethodException).GetConstructor(instanceFlags, null, new Type[] { typeof(string), typeof(Exception), typeof(string), typeof(object[]) }, null); + typeof(MethodException).GetConstructor(instanceFlags, null, + new Type[] { typeof(string), typeof(Exception), typeof(string), typeof(object[]) }, null); internal static readonly MethodInfo MutableTuple_IsValueSet = - typeof(MutableTuple).GetMethod(nameof(MutableTuple.IsValueSet), instanceFlags, null, new Type[] { typeof(int) }, null); + typeof(MutableTuple).GetMethod(nameof(MutableTuple.IsValueSet), instanceFlags); internal static readonly MethodInfo Object_Equals = typeof(object).GetMethod(nameof(object.Equals), new Type[] { typeof(object) }); internal static readonly ConstructorInfo OrderedDictionary_ctor = - typeof(OrderedDictionary).GetConstructor(BindingFlags.Instance | BindingFlags.Public, null, CallingConventions.Standard, new Type[] { typeof(int), typeof(IEqualityComparer) }, null); + typeof(OrderedDictionary).GetConstructor(BindingFlags.Instance | BindingFlags.Public, null, + CallingConventions.Standard, new Type[] { typeof(int), typeof(IEqualityComparer) }, null); internal static readonly MethodInfo Parser_ScanNumber = - typeof(Parser).GetMethod(nameof(Parser.ScanNumber), staticFlags, null, new Type[] { typeof(string), typeof(Type), typeof(bool) }, null); + typeof(Parser).GetMethod(nameof(Parser.ScanNumber), staticFlags); internal static readonly MethodInfo ParserOps_ContainsOperatorCompiled = typeof(ParserOps).GetMethod(nameof(ParserOps.ContainsOperatorCompiled), staticFlags); internal static readonly MethodInfo ParserOps_ImplicitOp = - typeof(ParserOps).GetMethod(nameof(ParserOps.ImplicitOp), staticFlags, null, new Type[] { typeof(object), typeof(object), typeof(string), typeof(IScriptExtent), typeof(string) }, null); + typeof(ParserOps).GetMethod(nameof(ParserOps.ImplicitOp), staticFlags); internal static readonly MethodInfo ParserOps_JoinOperator = - typeof(ParserOps).GetMethod(nameof(ParserOps.JoinOperator), staticFlags, null, new Type[] { typeof(ExecutionContext), typeof(IScriptExtent), typeof(object), typeof(object) }, null); + typeof(ParserOps).GetMethod(nameof(ParserOps.JoinOperator), staticFlags); internal static readonly MethodInfo ParserOps_LikeOperator = - typeof(ParserOps).GetMethod(nameof(ParserOps.LikeOperator), staticFlags, null, new Type[] { typeof(ExecutionContext), typeof(IScriptExtent), typeof(object), typeof(object), typeof(TokenKind) }, null); + typeof(ParserOps).GetMethod(nameof(ParserOps.LikeOperator), staticFlags); internal static readonly MethodInfo ParserOps_MatchOperator = typeof(ParserOps).GetMethod(nameof(ParserOps.MatchOperator), staticFlags); internal static readonly MethodInfo ParserOps_RangeOperator = From 258258f3ca1385c071f7732a6c27c0ec7c602091 Mon Sep 17 00:00:00 2001 From: Ilya Date: Fri, 8 Mar 2019 17:40:04 +0500 Subject: [PATCH 19/23] Revert "Step 4" This reverts commit 53c3a93bd990fd63bc610df67d2c5569c12b225d. --- .../engine/parser/Compiler.cs | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/src/System.Management.Automation/engine/parser/Compiler.cs b/src/System.Management.Automation/engine/parser/Compiler.cs index d65404daaf6..9a9c8a7dc56 100644 --- a/src/System.Management.Automation/engine/parser/Compiler.cs +++ b/src/System.Management.Automation/engine/parser/Compiler.cs @@ -124,19 +124,19 @@ internal static class CachedReflectionInfo typeof(Exception).GetProperty(nameof(Exception.Message)); internal static readonly MethodInfo ExceptionHandlingOps_CheckActionPreference = - typeof(ExceptionHandlingOps).GetMethod(nameof(ExceptionHandlingOps.CheckActionPreference), staticFlags, null, new Type[] { typeof(FunctionContext), typeof(Exception) }, null); + typeof(ExceptionHandlingOps).GetMethod(nameof(ExceptionHandlingOps.CheckActionPreference), staticFlags); internal static readonly MethodInfo ExceptionHandlingOps_ConvertToArgumentConversionException = - typeof(ExceptionHandlingOps).GetMethod(nameof(ExceptionHandlingOps.ConvertToArgumentConversionException), staticFlags, null, new Type[] { typeof(Exception), typeof(string), typeof(object), typeof(string), typeof(Type) }, null); + typeof(ExceptionHandlingOps).GetMethod(nameof(ExceptionHandlingOps.ConvertToArgumentConversionException), staticFlags); internal static readonly MethodInfo ExceptionHandlingOps_ConvertToException = - typeof(ExceptionHandlingOps).GetMethod(nameof(ExceptionHandlingOps.ConvertToException), staticFlags, null, new Type[] { typeof(object), typeof(IScriptExtent) }, null); + typeof(ExceptionHandlingOps).GetMethod(nameof(ExceptionHandlingOps.ConvertToException), staticFlags); internal static readonly MethodInfo ExceptionHandlingOps_ConvertToMethodInvocationException = - typeof(ExceptionHandlingOps).GetMethod(nameof(ExceptionHandlingOps.ConvertToMethodInvocationException), staticFlags, null, new Type[] { typeof(Exception), typeof(Type), typeof(string), typeof(int), typeof(MemberInfo) }, null); + typeof(ExceptionHandlingOps).GetMethod(nameof(ExceptionHandlingOps.ConvertToMethodInvocationException), staticFlags); internal static readonly MethodInfo ExceptionHandlingOps_FindMatchingHandler = - typeof(ExceptionHandlingOps).GetMethod(nameof(ExceptionHandlingOps.FindMatchingHandler), staticFlags, null, new Type[] { typeof(MutableTuple), typeof(RuntimeException), typeof(Type[]), typeof(ExecutionContext) }, null); + typeof(ExceptionHandlingOps).GetMethod(nameof(ExceptionHandlingOps.FindMatchingHandler), staticFlags); internal static readonly MethodInfo ExceptionHandlingOps_RestoreStoppingPipeline = - typeof(ExceptionHandlingOps).GetMethod(nameof(ExceptionHandlingOps.RestoreStoppingPipeline), staticFlags, null, new Type[] { typeof(ExecutionContext), typeof(bool) }, null); + typeof(ExceptionHandlingOps).GetMethod(nameof(ExceptionHandlingOps.RestoreStoppingPipeline), staticFlags); internal static readonly MethodInfo ExceptionHandlingOps_SuspendStoppingPipeline = - typeof(ExceptionHandlingOps).GetMethod(nameof(ExceptionHandlingOps.SuspendStoppingPipeline), staticFlags, null, new Type[] { typeof(ExecutionContext) }, null); + typeof(ExceptionHandlingOps).GetMethod(nameof(ExceptionHandlingOps.SuspendStoppingPipeline), staticFlags); internal static readonly PropertyInfo ExecutionContext_CurrentExceptionBeingHandled = typeof(ExecutionContext).GetProperty(nameof(ExecutionContext.CurrentExceptionBeingHandled), instanceFlags); @@ -147,7 +147,7 @@ internal static class CachedReflectionInfo internal static readonly PropertyInfo ExecutionContext_ExceptionHandlerInEnclosingStatementBlock = typeof(ExecutionContext).GetProperty(nameof(ExecutionContext.PropagateExceptionsToEnclosingStatementBlock), instanceFlags); internal static readonly MethodInfo ExecutionContext_IsStrictVersion = - typeof(ExecutionContext).GetMethod(nameof(ExecutionContext.IsStrictVersion), staticFlags, null, new Type[] { typeof(ExecutionContext), typeof(int) }, null); + typeof(ExecutionContext).GetMethod(nameof(ExecutionContext.IsStrictVersion), staticFlags); internal static readonly PropertyInfo ExecutionContext_QuestionMarkVariableValue = typeof(ExecutionContext).GetProperty(nameof(ExecutionContext.QuestionMarkVariableValue), instanceFlags); internal static readonly PropertyInfo ExecutionContext_LanguageMode = @@ -155,13 +155,14 @@ internal static class CachedReflectionInfo internal static readonly PropertyInfo ExecutionContext_EngineIntrinsics = typeof(ExecutionContext).GetProperty(nameof(ExecutionContext.EngineIntrinsics), instanceFlags); internal static readonly MethodInfo FileRedirection_BindForExpression = - typeof(FileRedirection).GetMethod(nameof(FileRedirection.BindForExpression), instanceFlags, null, new Type[] { typeof(FunctionContext) }, null); + typeof(FileRedirection).GetMethod(nameof(FileRedirection.BindForExpression), instanceFlags); internal static readonly MethodInfo FileRedirection_CallDoCompleteForExpression = - typeof(FileRedirection).GetMethod(nameof(FileRedirection.CallDoCompleteForExpression), instanceFlags, null, Type.EmptyTypes, null); + typeof(FileRedirection).GetMethod(nameof(FileRedirection.CallDoCompleteForExpression), instanceFlags); internal static readonly ConstructorInfo FileRedirection_ctor = - typeof(FileRedirection).GetConstructor(instanceFlags, null, CallingConventions.Standard, new Type[] { typeof(RedirectionStream), typeof(bool), typeof(string) }, null); + typeof(FileRedirection).GetConstructor(instanceFlags, null, CallingConventions.Standard, + new Type[] { typeof(RedirectionStream), typeof(bool), typeof(string) }, null); internal static readonly MethodInfo FileRedirection_Dispose = - typeof(FileRedirection).GetMethod(nameof(FileRedirection.Dispose), Type.EmptyTypes); + typeof(FileRedirection).GetMethod(nameof(FileRedirection.Dispose)); internal static readonly FieldInfo FunctionContext__currentSequencePointIndex = typeof(FunctionContext).GetField(nameof(FunctionContext._currentSequencePointIndex), instanceFlags); @@ -174,20 +175,21 @@ internal static class CachedReflectionInfo internal static readonly FieldInfo FunctionContext__outputPipe = typeof(FunctionContext).GetField(nameof(FunctionContext._outputPipe), instanceFlags); internal static readonly MethodInfo FunctionContext_PopTrapHandlers = - typeof(FunctionContext).GetMethod(nameof(FunctionContext.PopTrapHandlers), instanceFlags, null, Type.EmptyTypes, null); + typeof(FunctionContext).GetMethod(nameof(FunctionContext.PopTrapHandlers), instanceFlags); internal static readonly MethodInfo FunctionContext_PushTrapHandlers = - typeof(FunctionContext).GetMethod(nameof(FunctionContext.PushTrapHandlers), instanceFlags, null, new Type[] { typeof(Type[]), typeof(Action[]), typeof(Type[]) }, null); + typeof(FunctionContext).GetMethod(nameof(FunctionContext.PushTrapHandlers), instanceFlags); internal static readonly MethodInfo FunctionOps_DefineFunction = - typeof(FunctionOps).GetMethod(nameof(FunctionOps.DefineFunction), staticFlags, null, new Type[] { typeof(ExecutionContext), typeof(FunctionDefinitionAst), typeof(ScriptBlockExpressionWrapper) }, null); + typeof(FunctionOps).GetMethod(nameof(FunctionOps.DefineFunction), staticFlags); internal static readonly ConstructorInfo Hashtable_ctor = - typeof(Hashtable).GetConstructor(BindingFlags.Instance | BindingFlags.Public, null, CallingConventions.Standard, new Type[] { typeof(int), typeof(IEqualityComparer) }, null); + typeof(Hashtable).GetConstructor(BindingFlags.Instance | BindingFlags.Public, null, + CallingConventions.Standard, new Type[] { typeof(int), typeof(IEqualityComparer) }, null); internal static readonly MethodInfo HashtableOps_Add = - typeof(HashtableOps).GetMethod(nameof(HashtableOps.Add), staticFlags, null, new Type[] { typeof(IDictionary), typeof(IDictionary) }, null); + typeof(HashtableOps).GetMethod(nameof(HashtableOps.Add), staticFlags); internal static readonly MethodInfo HashtableOps_AddKeyValuePair = - typeof(HashtableOps).GetMethod(nameof(HashtableOps.AddKeyValuePair), staticFlags, null, new Type[] { typeof(IDictionary), typeof(object), typeof(object), typeof(IScriptExtent) }, null); + typeof(HashtableOps).GetMethod(nameof(HashtableOps.AddKeyValuePair), staticFlags); internal static readonly PropertyInfo ICollection_Count = typeof(ICollection).GetProperty(nameof(ICollection.Count)); From f501a405adff90d5557925b86a40e4ba8647a9ab Mon Sep 17 00:00:00 2001 From: Ilya Date: Fri, 8 Mar 2019 17:40:07 +0500 Subject: [PATCH 20/23] Revert "Step 3" This reverts commit 9893dd4969e781f700772ce82b57af83a3c4fdb2. --- .../engine/parser/Compiler.cs | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/System.Management.Automation/engine/parser/Compiler.cs b/src/System.Management.Automation/engine/parser/Compiler.cs index 9a9c8a7dc56..e3cebc0d866 100644 --- a/src/System.Management.Automation/engine/parser/Compiler.cs +++ b/src/System.Management.Automation/engine/parser/Compiler.cs @@ -93,32 +93,33 @@ internal static class CachedReflectionInfo internal static readonly MethodInfo EnumerableOps_Compare = typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.Compare), staticFlags, null, new Type[] { typeof(IEnumerator), typeof(object), typeof(Func) }, null); internal static readonly MethodInfo EnumerableOps_GetEnumerator = - typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.GetEnumerator), staticFlags, null, new Type[] { typeof(IEnumerable) }, null); + typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.GetEnumerator), staticFlags); internal static readonly MethodInfo EnumerableOps_GetCOMEnumerator = - typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.GetCOMEnumerator), staticFlags, null, new Type[] { typeof(object) }, null); + typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.GetCOMEnumerator), staticFlags); internal static readonly MethodInfo EnumerableOps_GetGenericEnumerator = typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.GetGenericEnumerator), staticFlags); internal static readonly MethodInfo EnumerableOps_GetSlice = - typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.GetSlice), staticFlags, null, new Type[] { typeof(IList), typeof(int) }, null); + typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.GetSlice), staticFlags); internal static readonly MethodInfo EnumerableOps_MethodInvoker = - typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.MethodInvoker), staticFlags, null, new Type[] { typeof(PSInvokeMemberBinder), typeof(Type), typeof(IEnumerator), typeof(object[]), typeof(Type) }, null); + typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.MethodInvoker), staticFlags); internal static readonly MethodInfo EnumerableOps_Where = - typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.Where), staticFlags, null, new Type[] { typeof(IEnumerator), typeof(ScriptBlock), typeof(WhereOperatorSelectionMode), typeof(int) }, null); + typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.Where), staticFlags); internal static readonly MethodInfo EnumerableOps_ForEach = - typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.ForEach), staticFlags, null, new Type[] { typeof(IEnumerator), typeof(object), typeof(object[]) }, null); + typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.ForEach), staticFlags); internal static readonly MethodInfo EnumerableOps_Multiply = - typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.Multiply), staticFlags, null, new Type[] { typeof(IEnumerator), typeof(uint) }, null); + typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.Multiply), staticFlags); internal static readonly MethodInfo EnumerableOps_PropertyGetter = - typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.PropertyGetter), staticFlags, null, new Type[] { typeof(PSGetMemberBinder), typeof(IEnumerator) }, null); + typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.PropertyGetter), staticFlags); internal static readonly MethodInfo EnumerableOps_SlicingIndex = - typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.SlicingIndex), staticFlags, null, new Type[] { typeof(object), typeof(IEnumerator), typeof(Func) }, null); + typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.SlicingIndex), staticFlags); internal static readonly MethodInfo EnumerableOps_ToArray = - typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.ToArray), staticFlags, null, new Type[] { typeof(IEnumerator) }, null); + typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.ToArray), staticFlags); internal static readonly MethodInfo EnumerableOps_WriteEnumerableToPipe = - typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.WriteEnumerableToPipe), staticFlags, null, new Type[] { typeof(IEnumerator), typeof(Pipe), typeof(ExecutionContext), typeof(bool) }, null); + typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.WriteEnumerableToPipe), staticFlags); internal static readonly ConstructorInfo ErrorRecord__ctor = - typeof(ErrorRecord).GetConstructor(instanceFlags | BindingFlags.Public, null, CallingConventions.Standard, new Type[] { typeof(ErrorRecord), typeof(RuntimeException) }, null); + typeof(ErrorRecord).GetConstructor(instanceFlags | BindingFlags.Public, null, CallingConventions.Standard, + new Type[] { typeof(ErrorRecord), typeof(RuntimeException) }, null); internal static readonly PropertyInfo Exception_Message = typeof(Exception).GetProperty(nameof(Exception.Message)); From fb54d4940c9634943c9c23eb5c9a8e65302db4a3 Mon Sep 17 00:00:00 2001 From: Ilya Date: Fri, 8 Mar 2019 17:40:10 +0500 Subject: [PATCH 21/23] Revert "Step 2" This reverts commit b2f7b0ea382dd338ed2250c8fcccee39a1a0da6e. --- .../engine/parser/Compiler.cs | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/System.Management.Automation/engine/parser/Compiler.cs b/src/System.Management.Automation/engine/parser/Compiler.cs index e3cebc0d866..75e91ba30f7 100644 --- a/src/System.Management.Automation/engine/parser/Compiler.cs +++ b/src/System.Management.Automation/engine/parser/Compiler.cs @@ -48,21 +48,22 @@ internal static class CachedReflectionInfo internal static readonly MethodInfo ArrayOps_Multiply = typeof(ArrayOps).GetMethod(nameof(ArrayOps.Multiply), genericParameterCount: 1, staticFlags, null, new Type[] { Type.MakeGenericMethodParameter(0).MakeArrayType(), typeof(uint) }, null); internal static readonly MethodInfo ArrayOps_SetMDArrayValue = - typeof(ArrayOps).GetMethod(nameof(ArrayOps.SetMDArrayValue), staticFlags, null, new Type[] { typeof(Array), typeof(int[]), typeof(object) }, null); + typeof(ArrayOps).GetMethod(nameof(ArrayOps.SetMDArrayValue), staticFlags); internal static readonly MethodInfo ArrayOps_SlicingIndex = - typeof(ArrayOps).GetMethod(nameof(ArrayOps.SlicingIndex), staticFlags, null, new Type[] { typeof(object), typeof(object[]), typeof(Func) }, null); + typeof(ArrayOps).GetMethod(nameof(ArrayOps.SlicingIndex), staticFlags); internal static readonly ConstructorInfo BreakException_ctor = - typeof(BreakException).GetConstructor(instanceFlags, null, CallingConventions.Standard, new Type[] { typeof(string) }, null); + typeof(BreakException).GetConstructor(instanceFlags, null, CallingConventions.Standard, + new Type[] { typeof(string) }, null); internal static readonly MethodInfo CharOps_CompareIeq = - typeof(CharOps).GetMethod(nameof(CharOps.CompareIeq), staticFlags, null, new Type[] { typeof(char), typeof(char) }, null); + typeof(CharOps).GetMethod(nameof(CharOps.CompareIeq), staticFlags); internal static readonly MethodInfo CharOps_CompareIne = - typeof(CharOps).GetMethod(nameof(CharOps.CompareIne), staticFlags, null, new Type[] { typeof(char), typeof(char) }, null); + typeof(CharOps).GetMethod(nameof(CharOps.CompareIne), staticFlags); internal static readonly MethodInfo CharOps_CompareStringIeq = - typeof(CharOps).GetMethod(nameof(CharOps.CompareStringIeq), staticFlags, null, new Type[] { typeof(char), typeof(string) }, null); + typeof(CharOps).GetMethod(nameof(CharOps.CompareStringIeq), staticFlags); internal static readonly MethodInfo CharOps_CompareStringIne = - typeof(CharOps).GetMethod(nameof(CharOps.CompareStringIne), staticFlags, null, new Type[] { typeof(char), typeof(string) }, null); + typeof(CharOps).GetMethod(nameof(CharOps.CompareStringIne), staticFlags); internal static readonly MethodInfo CommandParameterInternal_CreateArgument = typeof(CommandParameterInternal).GetMethod(nameof(CommandParameterInternal.CreateArgument), staticFlags); internal static readonly MethodInfo CommandParameterInternal_CreateParameter = @@ -74,24 +75,25 @@ internal static class CachedReflectionInfo typeof(CommandRedirection).GetMethod(nameof(CommandRedirection.UnbindForExpression), instanceFlags); internal static readonly ConstructorInfo ContinueException_ctor = - typeof(ContinueException).GetConstructor(instanceFlags, null, CallingConventions.Standard, new Type[] { typeof(string) }, null); + typeof(ContinueException).GetConstructor(instanceFlags, null, CallingConventions.Standard, + new Type[] { typeof(string) }, null); internal static readonly MethodInfo Convert_ChangeType = typeof(Convert).GetMethod(nameof(Convert.ChangeType), new Type[] { typeof(object), typeof(Type) }); internal static readonly MethodInfo Debugger_EnterScriptFunction = - typeof(ScriptDebugger).GetMethod(nameof(ScriptDebugger.EnterScriptFunction), instanceFlags, null, new Type[] { typeof(FunctionContext) }, null); + typeof(ScriptDebugger).GetMethod(nameof(ScriptDebugger.EnterScriptFunction), instanceFlags); internal static readonly MethodInfo Debugger_ExitScriptFunction = - typeof(ScriptDebugger).GetMethod(nameof(ScriptDebugger.ExitScriptFunction), instanceFlags, null, Type.EmptyTypes, null); + typeof(ScriptDebugger).GetMethod(nameof(ScriptDebugger.ExitScriptFunction), instanceFlags); internal static readonly MethodInfo Debugger_OnSequencePointHit = - typeof(ScriptDebugger).GetMethod(nameof(ScriptDebugger.OnSequencePointHit), instanceFlags, null, new Type[] { typeof(FunctionContext) }, null); + typeof(ScriptDebugger).GetMethod(nameof(ScriptDebugger.OnSequencePointHit), instanceFlags); internal static readonly MethodInfo EnumerableOps_AddEnumerable = - typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.AddEnumerable), staticFlags, null, new Type[] { typeof(ExecutionContext), typeof(IEnumerator), typeof(IEnumerator) }, null); + typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.AddEnumerable), staticFlags); internal static readonly MethodInfo EnumerableOps_AddObject = - typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.AddObject), staticFlags, null, new Type[] { typeof(ExecutionContext), typeof(IEnumerator), typeof(object) }, null); + typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.AddObject), staticFlags); internal static readonly MethodInfo EnumerableOps_Compare = - typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.Compare), staticFlags, null, new Type[] { typeof(IEnumerator), typeof(object), typeof(Func) }, null); + typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.Compare), staticFlags); internal static readonly MethodInfo EnumerableOps_GetEnumerator = typeof(EnumerableOps).GetMethod(nameof(EnumerableOps.GetEnumerator), staticFlags); internal static readonly MethodInfo EnumerableOps_GetCOMEnumerator = From 4307a73e52e22e5788d1708e5d64a8fe7b992c5d Mon Sep 17 00:00:00 2001 From: Ilya Date: Fri, 8 Mar 2019 17:40:15 +0500 Subject: [PATCH 22/23] Revert "Step 1" This reverts commit 345eb6d250e187590cebf90d812d30ddec8cf5ef. --- .../engine/parser/Compiler.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/System.Management.Automation/engine/parser/Compiler.cs b/src/System.Management.Automation/engine/parser/Compiler.cs index 75e91ba30f7..974fc59b6d3 100644 --- a/src/System.Management.Automation/engine/parser/Compiler.cs +++ b/src/System.Management.Automation/engine/parser/Compiler.cs @@ -38,15 +38,15 @@ internal static class CachedReflectionInfo typeof(List).GetMethod(nameof(List.ToArray), PSTypeExtensions.EmptyTypes); internal static readonly MethodInfo ArrayOps_GetMDArrayValue = - typeof(ArrayOps).GetMethod(nameof(ArrayOps.GetMDArrayValue), staticFlags, null, new Type[] { typeof(Array), typeof(int[]), typeof(bool) }, null); + typeof(ArrayOps).GetMethod(nameof(ArrayOps.GetMDArrayValue), staticFlags); internal static readonly MethodInfo ArrayOps_GetMDArrayValueOrSlice = - typeof(ArrayOps).GetMethod(nameof(ArrayOps.GetMDArrayValueOrSlice), staticFlags, null, new Type[] { typeof(Array), typeof(object) }, null); + typeof(ArrayOps).GetMethod(nameof(ArrayOps.GetMDArrayValueOrSlice), staticFlags); internal static readonly MethodInfo ArrayOps_GetNonIndexable = - typeof(ArrayOps).GetMethod(nameof(ArrayOps.GetNonIndexable), staticFlags, null, new Type[] { typeof(object), typeof(object[]) }, null); + typeof(ArrayOps).GetMethod(nameof(ArrayOps.GetNonIndexable), staticFlags); internal static readonly MethodInfo ArrayOps_IndexStringMessage = - typeof(ArrayOps).GetMethod(nameof(ArrayOps.IndexStringMessage), staticFlags, null, new Type[] { typeof(object) }, null); + typeof(ArrayOps).GetMethod(nameof(ArrayOps.IndexStringMessage), staticFlags); internal static readonly MethodInfo ArrayOps_Multiply = - typeof(ArrayOps).GetMethod(nameof(ArrayOps.Multiply), genericParameterCount: 1, staticFlags, null, new Type[] { Type.MakeGenericMethodParameter(0).MakeArrayType(), typeof(uint) }, null); + typeof(ArrayOps).GetMethod(nameof(ArrayOps.Multiply), staticFlags); internal static readonly MethodInfo ArrayOps_SetMDArrayValue = typeof(ArrayOps).GetMethod(nameof(ArrayOps.SetMDArrayValue), staticFlags); internal static readonly MethodInfo ArrayOps_SlicingIndex = From 2d69b064a88aab068d426975159404ae701305c5 Mon Sep 17 00:00:00 2001 From: Ilya Date: Fri, 8 Mar 2019 17:43:45 +0500 Subject: [PATCH 23/23] StreamReader.ReadLine --- src/System.Management.Automation/engine/parser/Compiler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Management.Automation/engine/parser/Compiler.cs b/src/System.Management.Automation/engine/parser/Compiler.cs index 974fc59b6d3..573667d5907 100644 --- a/src/System.Management.Automation/engine/parser/Compiler.cs +++ b/src/System.Management.Automation/engine/parser/Compiler.cs @@ -413,7 +413,7 @@ internal static class CachedReflectionInfo internal static readonly ConstructorInfo StreamReader_ctor = typeof(StreamReader).GetConstructor(new Type[] { typeof(string) }); internal static readonly MethodInfo StreamReader_ReadLine = - typeof(StreamReader).GetMethod(nameof(StreamReader.ReadLine)); + typeof(StreamReader).GetMethod(nameof(StreamReader.ReadLine), Type.EmptyTypes); internal static readonly ConstructorInfo String_ctor_char_int = typeof(string).GetConstructor(new Type[] { typeof(char), typeof(int) });