1 implementation of Target
Microsoft.CodeAnalysis (1)
Generated\Operations.Generated.cs (1)
6239public IOperation Target { get; }
163 references to Target
ILLink.RoslynAnalyzer (5)
DataFlow\LocalDataFlowVisitor.cs (2)
343 Debug.Assert (operation.Target is not IFlowCaptureReferenceOperation); 387 var targetOperation = operation.Target;
DataFlow\LValueFlowCaptureProvider.cs (1)
44 if (assignment?.Target == flowCaptureReference)
IOperationExtensions.cs (2)
108 assignmentOperation.Target == operation) { 210 return deconstructionAssignment.Target == previousOperation;
Microsoft.Analyzers.Extra (4)
AsyncCallInsideUsingBlockAnalyzer.cs (1)
107var assignmentTarget = ((IAssignmentOperation)operation).Target as ILocalReferenceOperation;
CoalesceAnalyzer.cs (3)
34var type = op.Target.Type; 39if (op.Target.Kind == OperationKind.ParameterReference) 41var pr = (IParameterReferenceOperation)op.Target;
Microsoft.AspNetCore.Analyzers (1)
OptionsAnalyzer.cs (1)
29operation.Target is IPropertyReferenceOperation property &&
Microsoft.AspNetCore.App.Analyzers (2)
Authorization\AddAuthorizationBuilderAnalyzer.cs (2)
147if (expressionStatementOperation is ISimpleAssignmentOperation { Target: IPropertyReferenceOperation { Property.ContainingType: { } propertyReferenceContainingType } } 179if (propertyReferenceOperation.Parent is IAssignmentOperation { Target: IPropertyReferenceOperation targetProperty }
Microsoft.AspNetCore.Components.Analyzers (1)
ComponentParameterUsageAnalyzer.cs (1)
45leftHandSide = assignmentOperation.Target;
Microsoft.AspNetCore.Components.SdkAnalyzers (1)
ComponentParameterUsageAnalyzer.cs (1)
45leftHandSide = assignmentOperation.Target;
Microsoft.AspNetCore.Mvc.Api.Analyzers (1)
ActualApiResponseMetadataFactory.cs (1)
165assignmentOperation.Target is not IPropertyReferenceOperation propertyReference)
Microsoft.CodeAnalysis (24)
Generated\Operations.Generated.cs (6)
1505/// Conversion applied to <see cref="IAssignmentOperation.Target" /> before the operation occurs. 1510/// <see cref="IAssignmentOperation.Target" />. 3087/// <item><description><see cref="IAssignmentOperation.Target" /> is evaluated for null. If it is null, <see cref="IAssignmentOperation.Value" /> is evaluated and assigned to target</description></item> 3088/// <item><description><see cref="IAssignmentOperation.Value" /> is conditionally evaluated if <see cref="IAssignmentOperation.Target" /> is null, and the result is assigned into <see cref="IAssignmentOperation.Target" /></description></item> 3090/// The result of the entire expression is <see cref="IAssignmentOperation.Target" />, which is only evaluated once.
Operations\ControlFlowGraphBuilder.cs (18)
2102PushOperand(VisitRequired(operation.Target)); 3111PushOperand(VisitRequired(operation.Target)); 3129if (operation.Target?.Type?.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T && 3130((INamedTypeSymbol)operation.Target.Type!).TypeArguments[0].Equals(operation.Type)) 3185operation.Target.Syntax, 3201GetCaptureReference(intermediateResult, operation.Target))); 3232value: CreateConversion(whenNullValue, operation.Target.Type), 3235type: operation.Target.Type, 6079bool pushSuccess = tryPushTarget(assignmentOperation.Target); 6094IOperation left = popTarget(assignmentOperation.Target); 6390var propertyReference = (IPropertyReferenceOperation)simpleAssignment.Target; 6664(IOperation visitedTarget, IOperation visitedValue) = VisitPreservingTupleOperations(operation.Target, operation.Value); 7987if (simpleAssignment.Target.Kind != OperationKind.PropertyReference) 7989Debug.Assert(simpleAssignment.Target is InvalidOperation); 7994var propertyReference = (IPropertyReferenceOperation)simpleAssignment.Target; 8080if (simpleAssignment.Target.Kind != OperationKind.PropertyReference) 8082Debug.Assert(simpleAssignment.Target is InvalidOperation); 8086var propertyReference = (IPropertyReferenceOperation)simpleAssignment.Target;
Microsoft.CodeAnalysis.CodeStyle (24)
src\Analyzers\Core\Analyzers\Helpers\HashCodeAnalyzer\HashCodeAnalyzer.cs (1)
201!IsLocalReference(simpleAssignment.Target, hashCodeVariable) ||
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\SuppressMessageAttributeState.cs (1)
62if (simpleAssignment.Target is IPropertyReferenceOperation propertyReference &&
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (2)
365compoundAssignment.Target == memberReference || 367coalesceAssignment.Target == memberReference ||
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (7)
275(assignment.Target.Kind == OperationKind.LocalReference || 276assignment.Target.Kind == OperationKind.ParameterReference)) 331if (assignmentOperation.Target == operation) 341if (assignmentOperation.Target.Type.IsDelegateType() && 342(assignmentOperation.Target.Kind == OperationKind.LocalReference || 343assignmentOperation.Target.Kind == OperationKind.ParameterReference)) 641assignment.Target == unusedSymbolWriteOperation)
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForAssignment\UseConditionalExpressionForAssignmentHelpers.cs (7)
50!syntaxFacts.AreEquivalent(trueAssignment.Target.Syntax, falseAssignment.Target.Syntax)) 67if (trueAssignment?.Target is IDiscardOperation && 68falseAssignment?.Target is IDiscardOperation && 74if (ReferencesDeclaredVariableInAssignment(ifOperation.Condition, trueAssignment?.Target, falseAssignment?.Target)) 157assignmentOp.Target != null)
src\Analyzers\Core\Analyzers\UseThrowExpression\AbstractUseThrowExpressionDiagnosticAnalyzer.cs (1)
162var exprDataFlow = semanticModel.AnalyzeDataFlow(assignmentExpression.Target.Syntax);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (3)
20assignmentOperation.Target == operation && 129assignmentOperation.Target == operation) 269return deconstructionAssignment.Target == previousOperation;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\LValueFlowCaptureProvider.cs (1)
57assignment.Target == flowCaptureReference ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
165assignmentOperation.Target == operation)
Microsoft.CodeAnalysis.CodeStyle.Fixes (6)
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentCodeFixProvider.cs (3)
111assignment.Target.Syntax, 164if (trueAssignment.Target is not ILocalReferenceOperation trueLocal) 172if (falseAssignment.Target is not ILocalReferenceOperation falseLocal)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\InitializeParameterHelpersCore.cs (2)
125Target: ITupleOperation targetTupleTemp, 175return InitializeParameterHelpersCore.IsFieldOrPropertyReference(assignmentExpression.Target, containingType, out fieldOrProperty);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\NullableHelpers.cs (1)
147IAssignmentOperation assignment => IsSymbolReferencedByOperation(assignment.Target),
Microsoft.CodeAnalysis.CSharp (1)
CSharpExtensions.cs (1)
831/// conversion is applied after the operator is applied, before the result is assigned to <see cref="IAssignmentOperation.Target"/>.
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\Analyzers\CSharp\Analyzers\MakeStructFieldsWritable\CSharpMakeStructFieldsWritableDiagnosticAnalyzer.cs (1)
103if (operationAssigmnent.Target is IInstanceReferenceOperation { ReferenceKind: InstanceReferenceKind.ContainingTypeInstance })
src\Analyzers\CSharp\Analyzers\UseSystemThreadingLock\CSharpUseSystemThreadingLockDiagnosticAnalyzer.cs (1)
202assignment.Target == fieldReferenceOperation &&
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (2)
384Target: IPropertyReferenceOperation { Property: IPropertySymbol property }, 439Target: IOperation assignee,
Microsoft.CodeAnalysis.CSharp.Features (4)
src\Analyzers\CSharp\Analyzers\MakeStructFieldsWritable\CSharpMakeStructFieldsWritableDiagnosticAnalyzer.cs (1)
103if (operationAssigmnent.Target is IInstanceReferenceOperation { ReferenceKind: InstanceReferenceKind.ContainingTypeInstance })
src\Analyzers\CSharp\Analyzers\UseSystemThreadingLock\CSharpUseSystemThreadingLockDiagnosticAnalyzer.cs (1)
202assignment.Target == fieldReferenceOperation &&
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (2)
384Target: IPropertyReferenceOperation { Property: IPropertySymbol property }, 439Target: IOperation assignee,
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (1)
Diagnostics\Suppression\RemoveUnnecessaryPragmaSuppressionsTests.cs (1)
83simpleAssignment.Target == localReference)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (29)
Semantics\DynamicTests.cs (27)
6696AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString()); 6805AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString()); 6915AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString()); 7012AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString()); 7189AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString()); 7302AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString()); 7418AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString()); 7532AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString()); 8308AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString()); 8417AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString()); 8526AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString()); 8636AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString()); 8745AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString()); 8814AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString()); 8886AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString()); 8942AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString()); 9032AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString()); 9123AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString()); 9213AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString()); 9269AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString()); 10045Assert.Equal(tupleTypeInfo.Type, operation.Target.Type); 10173Assert.Equal(tupleTypeInfo.Type, operation.Target.Type); 10301Assert.Equal(tupleTypeInfo.Type, operation.Target.Type); 10455Assert.Equal(tupleTypeInfo.Type, operation.Target.Type); 10589Assert.Equal(tupleTypeInfo.Type, operation.Target.Type); 10737Assert.Equal(tupleTypeInfo.Type, operation.Target.Type); 11007Assert.Equal(tupleTypeInfo.Type, operation.Target.Type);
Semantics\ObjectAndCollectionInitializerTests.cs (2)
4244AssertEx.Equal("System.Int32", operation.Target.Type.ToTestDisplayString()); 4298AssertEx.Equal("System.Int32", operation.Target.Type.ToTestDisplayString());
Microsoft.CodeAnalysis.Features (23)
InlineMethod\AbstractInlineMethodRefactoringProvider.MethodParametersInfo.cs (1)
491&& simpleAssignmentOperation.Target is IParameterReferenceOperation parameterOperation
src\Analyzers\Core\Analyzers\Helpers\HashCodeAnalyzer\HashCodeAnalyzer.cs (1)
201!IsLocalReference(simpleAssignment.Target, hashCodeVariable) ||
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\SuppressMessageAttributeState.cs (1)
62if (simpleAssignment.Target is IPropertyReferenceOperation propertyReference &&
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (2)
365compoundAssignment.Target == memberReference || 367coalesceAssignment.Target == memberReference ||
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (7)
275(assignment.Target.Kind == OperationKind.LocalReference || 276assignment.Target.Kind == OperationKind.ParameterReference)) 331if (assignmentOperation.Target == operation) 341if (assignmentOperation.Target.Type.IsDelegateType() && 342(assignmentOperation.Target.Kind == OperationKind.LocalReference || 343assignmentOperation.Target.Kind == OperationKind.ParameterReference)) 641assignment.Target == unusedSymbolWriteOperation)
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForAssignment\UseConditionalExpressionForAssignmentHelpers.cs (7)
50!syntaxFacts.AreEquivalent(trueAssignment.Target.Syntax, falseAssignment.Target.Syntax)) 67if (trueAssignment?.Target is IDiscardOperation && 68falseAssignment?.Target is IDiscardOperation && 74if (ReferencesDeclaredVariableInAssignment(ifOperation.Condition, trueAssignment?.Target, falseAssignment?.Target)) 157assignmentOp.Target != null)
src\Analyzers\Core\Analyzers\UseThrowExpression\AbstractUseThrowExpressionDiagnosticAnalyzer.cs (1)
162var exprDataFlow = semanticModel.AnalyzeDataFlow(assignmentExpression.Target.Syntax);
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentCodeFixProvider.cs (3)
111assignment.Target.Syntax, 164if (trueAssignment.Target is not ILocalReferenceOperation trueLocal) 172if (falseAssignment.Target is not ILocalReferenceOperation falseLocal)
Microsoft.CodeAnalysis.Test.Utilities (21)
Compilation\ControlFlowGraphVerifier.cs (2)
998assignment.Target == reference && 1896simpleAssignment.Target == propertyReference &&
Compilation\OperationTreeVerifier.cs (6)
1312Visit(operation.Target, nameof(operation.Target)); 1459var propertyReference = (IPropertyReferenceOperation)simpleAssignment.Target; 1668Visit(operation.Target, "Left"); 1677Visit(operation.Target, "Left"); 1714Visit(operation.Target, "Left");
Compilation\TestOperationVisitor.cs (3)
911AssertEx.Equal(new[] { operation.Target, operation.Value }, operation.ChildOperations); 1052var propertyReference = (IPropertyReferenceOperation)simpleAssignment.Target; 1158AssertEx.Equal(new[] { operation.Target, operation.Value }, operation.ChildOperations);
Diagnostics\CouldHaveMoreSpecificTypeAnalyzer.cs (1)
62AssignTo(assignment.Target, localsSourceTypes, fieldsSourceTypes, assignment.Value);
Diagnostics\FieldCouldBeReadOnlyAnalyzer.cs (1)
56AssignTo(assignment.Target, inConstructor, staticConstructorType, assignedToFields, mightBecomeReadOnlyFields);
Diagnostics\LocalCouldBeConstAnalyzer.cs (1)
50AssignTo(assignment.Target, assignedToLocals, mightBecomeConstLocals);
Diagnostics\OperationTestAnalyzer.cs (7)
173if (setupAssignment.Target.Kind == OperationKind.LocalReference && 174((ILocalReferenceOperation)setupAssignment.Target).Local == testVariable && 238if (advanceAssignment.Target.Kind == OperationKind.LocalReference && 239((ILocalReferenceOperation)advanceAssignment.Target).Local == testVariable && 262if (advanceAssignment.Target.Kind == OperationKind.LocalReference && 263((ILocalReferenceOperation)advanceAssignment.Target).Local == testVariable && 753var kind = assignment.Target.Kind;
Microsoft.CodeAnalysis.VisualBasic (1)
VisualBasicExtensions.vb (1)
1457''' conversion is applied after the operator is applied, before the result is assigned to <see cref="IAssignmentOperation.Target"/>.
Microsoft.CodeAnalysis.Workspaces (8)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (3)
20assignmentOperation.Target == operation && 129assignmentOperation.Target == operation) 269return deconstructionAssignment.Target == previousOperation;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\LValueFlowCaptureProvider.cs (1)
57assignment.Target == flowCaptureReference ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
165assignmentOperation.Target == operation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\InitializeParameterHelpersCore.cs (2)
125Target: ITupleOperation targetTupleTemp, 175return InitializeParameterHelpersCore.IsFieldOrPropertyReference(assignmentExpression.Target, containingType, out fieldOrProperty);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\NullableHelpers.cs (1)
147IAssignmentOperation assignment => IsSymbolReferencedByOperation(assignment.Target),
Roslyn.Compilers.VisualBasic.IOperation.UnitTests (2)
IOperation\IOperationTests.vb (2)
190Dim target1 As ILocalReferenceOperation = TryCast(assignment1.Target, ILocalReferenceOperation) 218Dim target2 As ILocalReferenceOperation = TryCast(assignment2.Target, ILocalReferenceOperation)