1 implementation of ILocalReferenceOperation
Microsoft.CodeAnalysis (1)
Generated\Operations.Generated.cs (1)
5292internal sealed partial class LocalReferenceOperation : Operation, ILocalReferenceOperation
88 references to ILocalReferenceOperation
ConfigurationSchemaGenerator (1)
RuntimeSource\Configuration.Binder\Parser\ConfigurationBinder.cs (1)
108ILocalReferenceOperation l => l.Local.Type,
ILLink.RoslynAnalyzer (6)
DataFlow\LocalDataFlowVisitor.cs (5)
169 public override TValue VisitLocalReference (ILocalReferenceOperation operation, LocalDataFlowState<TValue, TContext, TValueLattice, TContextLattice> state) 198 bool IsReferenceToCapturedVariable (ILocalReferenceOperation localReference) 209 TValue GetLocal (ILocalReferenceOperation operation, LocalDataFlowState<TValue, TContext, TValueLattice, TContextLattice> state) 222 void SetLocal (ILocalReferenceOperation operation, TValue value, LocalDataFlowState<TValue, TContext, TValueLattice, TContextLattice> state, bool merge = false) 318 case ILocalReferenceOperation localRef: {
IOperationExtensions.cs (1)
38 if (operation is ILocalReferenceOperation localReference &&
Microsoft.Analyzers.Extra (3)
AsyncCallInsideUsingBlockAnalyzer.cs (3)
107var assignmentTarget = ((IAssignmentOperation)operation).Target as ILocalReferenceOperation; 189if (operation is not ILocalReferenceOperation localReference)
Microsoft.AspNetCore.App.Analyzers (5)
Kestrel\ListenOnIPv6AnyAnalyzer.cs (1)
77if (addressArgument!.Value is ILocalReferenceOperation localReferenceOperation)
RouteHandlers\DetectAmbiguousRoutes.cs (4)
182if (builder is ILocalReferenceOperation local && other is ILocalReferenceOperation otherLocal) 242if (argument1 is ILocalReferenceOperation local && argument2 is ILocalReferenceOperation otherLocal)
Microsoft.CodeAnalysis (7)
Generated\OperationKind.Generated.cs (1)
65/// <summary>Indicates an <see cref="ILocalReferenceOperation"/>.</summary>
Generated\Operations.Generated.cs (3)
10911public override IOperation VisitLocalReference(ILocalReferenceOperation operation, object? argument) 11439public virtual void VisitLocalReference(ILocalReferenceOperation operation) => DefaultVisit(operation); 11578public virtual TResult? VisitLocalReference(ILocalReferenceOperation operation, TArgument argument) => DefaultVisit(operation, argument);
Operations\ControlFlowGraphBuilder.cs (3)
862!((ILocalReferenceOperation)value).Local.IsFunctionValue) 4480if (op is ILocalReferenceOperation l && l.Local.Equals(local)) 7112public override IOperation VisitLocalReference(ILocalReferenceOperation operation, int? captureIdForResult)
Microsoft.CodeAnalysis.CodeStyle (9)
src\Analyzers\Core\Analyzers\Helpers\HashCodeAnalyzer\HashCodeAnalyzer.cs (1)
225=> Unwrap(value) is ILocalReferenceOperation localReference && accumulatorVariable.Equals(localReference.Local);
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
303/// an <see cref="IParameterReferenceOperation"/> or an <see cref="ILocalReferenceOperation"/>
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForAssignment\UseConditionalExpressionForAssignmentHelpers.cs (2)
105if (operation is IDeclarationExpressionOperation { Expression: ILocalReferenceOperation localReference }) 125if (operation is ILocalReferenceOperation { Local: var local } &&
src\Analyzers\Core\Analyzers\UseThrowExpression\AbstractUseThrowExpressionDiagnosticAnalyzer.cs (1)
248else if (operation is ILocalReferenceOperation localReference)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (1)
51if (operation is ILocalReferenceOperation localReference &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (3)
245public override void VisitLocalReference(ILocalReferenceOperation operation) 475var localReference = (ILocalReferenceOperation)currentOperation;
Microsoft.CodeAnalysis.CodeStyle.Fixes (4)
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentCodeFixProvider.cs (3)
164if (trueAssignment.Target is not ILocalReferenceOperation trueLocal) 172if (falseAssignment.Target is not ILocalReferenceOperation falseLocal) 249if (operation is ILocalReferenceOperation localReference &&
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\NullableHelpers.cs (1)
145ILocalReferenceOperation localReference => localReference.Local.Equals(symbol),
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (1)
521if (operation is ILocalReferenceOperation { Local.DeclaringSyntaxReferences: [var syntaxRef, ..] } &&
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (2)
478if (operation is ILocalReferenceOperation) 614ILocalReferenceOperation localReference => localReference.Local,
Microsoft.CodeAnalysis.CSharp.Features (3)
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (1)
521if (operation is ILocalReferenceOperation { Local.DeclaringSyntaxReferences: [var syntaxRef, ..] } &&
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (2)
478if (operation is ILocalReferenceOperation) 614ILocalReferenceOperation localReference => localReference.Local,
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (2)
Diagnostics\Suppression\RemoveUnnecessaryPragmaSuppressionsTests.cs (2)
81var localReference = (ILocalReferenceOperation)context.Operation;
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1)
Semantics\TopLevelStatementsTests.cs (1)
599Assert.IsAssignableFrom<ILocalReferenceOperation>(operation2);
Microsoft.CodeAnalysis.Features (12)
InlineMethod\AbstractInlineMethodRefactoringProvider.InlineContext.cs (1)
414if (operation is ILocalReferenceOperation localReferenceOperation
src\Analyzers\Core\Analyzers\Helpers\HashCodeAnalyzer\HashCodeAnalyzer.cs (1)
225=> Unwrap(value) is ILocalReferenceOperation localReference && accumulatorVariable.Equals(localReference.Local);
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
303/// an <see cref="IParameterReferenceOperation"/> or an <see cref="ILocalReferenceOperation"/>
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForAssignment\UseConditionalExpressionForAssignmentHelpers.cs (2)
105if (operation is IDeclarationExpressionOperation { Expression: ILocalReferenceOperation localReference }) 125if (operation is ILocalReferenceOperation { Local: var local } &&
src\Analyzers\Core\Analyzers\UseThrowExpression\AbstractUseThrowExpressionDiagnosticAnalyzer.cs (1)
248else if (operation is ILocalReferenceOperation localReference)
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentCodeFixProvider.cs (3)
164if (trueAssignment.Target is not ILocalReferenceOperation trueLocal) 172if (falseAssignment.Target is not ILocalReferenceOperation falseLocal) 249if (operation is ILocalReferenceOperation localReference &&
ValueTracking\ValueTracker.OperationCollector.cs (3)
32ILocalReferenceOperation or 113ILocalReferenceOperation or 147ILocalReferenceOperation localReferenceOperation => AddOperationAsync(operation, localReferenceOperation.Local, cancellationToken),
Microsoft.CodeAnalysis.Test.Utilities (14)
Compilation\ControlFlowGraphVerifier.cs (1)
1703case ILocalReferenceOperation localReference:
Compilation\OperationTreeVerifier.cs (2)
978public override void VisitLocalReference(ILocalReferenceOperation operation) 980LogString(nameof(ILocalReferenceOperation));
Compilation\TestOperationVisitor.cs (1)
625public override void VisitLocalReference(ILocalReferenceOperation operation)
Diagnostics\CouldHaveMoreSpecificTypeAnalyzer.cs (1)
242ILocalSymbol targetLocal = ((ILocalReferenceOperation)target).Local;
Diagnostics\LocalCouldBeConstAnalyzer.cs (1)
118ILocalSymbol targetLocal = ((ILocalReferenceOperation)target).Local;
Diagnostics\OperationTestAnalyzer.cs (8)
165ILocalSymbol testVariable = ((ILocalReferenceOperation)conditionLeft).Local; 174((ILocalReferenceOperation)setupAssignment.Target).Local == testVariable && 239((ILocalReferenceOperation)advanceAssignment.Target).Local == testVariable && 248((ILocalReferenceOperation)advanceOperation.LeftOperand).Local == testVariable && 263((ILocalReferenceOperation)advanceAssignment.Target).Local == testVariable && 277((ILocalReferenceOperation)advanceAssignment.Target).Local == testVariable) 1617var leftLocal = ((ILocalReferenceOperation)left).Local; 1644var operandLocal = ((ILocalReferenceOperation)operand).Local;
Microsoft.CodeAnalysis.VisualBasic.Features (1)
ConvertForEachToFor\VisualBasicConvertForEachToForCodeRefactoringProvider.vb (1)
180Dim nextVariable = TryCast(foreachOperation.NextVariables(0), ILocalReferenceOperation)
Microsoft.CodeAnalysis.Workspaces (5)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (1)
51if (operation is ILocalReferenceOperation localReference &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (3)
245public override void VisitLocalReference(ILocalReferenceOperation operation) 475var localReference = (ILocalReferenceOperation)currentOperation;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\NullableHelpers.cs (1)
145ILocalReferenceOperation localReference => localReference.Local.Equals(symbol),
Roslyn.Compilers.VisualBasic.IOperation.UnitTests (12)
IOperation\IOperationTests.vb (12)
71Assert.Equal(DirectCast(left1, ILocalReferenceOperation).Local.Name, "x") 105Assert.Equal(DirectCast(left2, ILocalReferenceOperation).Local.Name, "x") 108Assert.Equal(DirectCast(right2, ILocalReferenceOperation).Local.Name, "y") 137Assert.Equal(DirectCast(operand3, ILocalReferenceOperation).Local.Name, "x") 190Dim target1 As ILocalReferenceOperation = TryCast(assignment1.Target, ILocalReferenceOperation) 193Dim value1 As ILocalReferenceOperation = TryCast(assignment1.Value, ILocalReferenceOperation) 218Dim target2 As ILocalReferenceOperation = TryCast(assignment2.Target, ILocalReferenceOperation) 221Dim value2 As ILocalReferenceOperation = TryCast(assignment2.Value, ILocalReferenceOperation)