Repository: PowerShell/PowerShell
File: src/System.Management.Automation/engine/parser/TypeInferenceVisitor.cs (C#)

Code before:
            /// </summary>
            internal ITypeName LastConstraint;
            
            /// <summary>
            /// The last ast that assigned a value to the variable. This determines the value of the variable unless a type constraint has been applied.
            /// </summary>
            internal Ast LastAssignment;
            
            /// <summary>
            /// The inferred type from the most recent assignment. This is only used for stream redirections to variables, or the special OutVariable common parameters.
            /// </summary>
            internal PSTypeName LastAssignmentType;
            
            /// <summary>
            /// Whether or not the types from the last assignment should be enumerated.
            /// For assignments made by the PipelineVariable parameter or the foreach statement.
            /// </summary>
            internal bool EnumerateAssignment;
            
            /// <summary>
            /// Whether or not the last assignment was via command redirection.
            /// </summary>
            internal bool RedirectionAssignment;

            /// <summary>
            /// The Ast of the scope we are currently analyzing
            /// </summary>
            internal Ast ScopeDefinitionAst;
            internal int StopSearchOffset;
            private int LastAssignmentOffset = -1;

            private void SetLastAssignment(Ast ast, bool enumerate = false, bool redirectionAssignment = false)
            {
                if (LastAssignmentOffset < ast.Extent.StartOffset)
                {
                    ClearAssignmentData();
                    LastAssignment = ast;
                    EnumerateAssignment = enumerate;
                    RedirectionAssignment = redirectionAssignment;
                    LastAssignmentOffset = ast.Extent.StartOffset;
                }
            }

            private void SetLastAssignmentType(PSTypeName typeName, int assignmentOffset)
            {
                if (LastAssignmentOffset < assignmentOffset)
                {
                    ClearAssignmentData();
                    LastAssignmentType = typeName;
                    LastAssignmentOffset = assignmentOffset;
                }

Review comment (suggestion):
```suggestion
            /// The Ast of the scope we are currently analyzing.
```

Code after:
            /// </summary>
            internal ITypeName LastConstraint;
            
            /// <summary>
            /// The last ast that assigned a value to the variable. This determines the value of the variable unless a type constraint has been applied.
            /// </summary>
            internal Ast LastAssignment;
            
            /// <summary>
            /// The inferred type from the most recent assignment. This is only used for stream redirections to variables, or the special OutVariable common parameters.
            /// </summary>
            internal PSTypeName LastAssignmentType;
            
            /// <summary>
            /// Whether or not the types from the last assignment should be enumerated.
            /// For assignments made by the PipelineVariable parameter or the foreach statement.
            /// </summary>
            internal bool EnumerateAssignment;
            
            /// <summary>
            /// Whether or not the last assignment was via command redirection.
            /// </summary>
            internal bool RedirectionAssignment;

            /// <summary>
            /// The Ast of the scope we are currently analyzing.
            /// </summary>
            internal Ast ScopeDefinitionAst;
            internal int StopSearchOffset;
            private int LastAssignmentOffset = -1;

            private void SetLastAssignment(Ast ast, bool enumerate = false, bool redirectionAssignment = false)
            {
                if (LastAssignmentOffset < ast.Extent.StartOffset)
                {
                    ClearAssignmentData();
                    LastAssignment = ast;
                    EnumerateAssignment = enumerate;
                    RedirectionAssignment = redirectionAssignment;
                    LastAssignmentOffset = ast.Extent.StartOffset;
                }
            }

            private void SetLastAssignmentType(PSTypeName typeName, int assignmentOffset)
            {
                if (LastAssignmentOffset < assignmentOffset)
                {
                    ClearAssignmentData();
                    LastAssignmentType = typeName;
                    LastAssignmentOffset = assignmentOffset;
                }