4 interfaces inheriting from IAssignmentOperation
Microsoft.CodeAnalysis (4)
Generated\Operations.Generated.cs (4)
1477public interface ISimpleAssignmentOperation : IAssignmentOperation 1502public interface ICompoundAssignmentOperation : IAssignmentOperation 2248public interface IDeconstructionAssignmentOperation : IAssignmentOperation 3106public interface ICoalesceAssignmentOperation : IAssignmentOperation
1 implementation of IAssignmentOperation
Microsoft.CodeAnalysis (1)
Generated\Operations.Generated.cs (1)
6231internal abstract partial class BaseAssignmentOperation : Operation, IAssignmentOperation
121 references to IAssignmentOperation
ILLink.RoslynAnalyzer (6)
DataFlow\LocalDataFlowVisitor.cs (2)
238 TValue ProcessSingleTargetAssignment (IOperation targetOperation, IAssignmentOperation operation, LocalDataFlowState<TValue, TContext, TValueLattice, TContextLattice> state, bool merge) 385 TValue ProcessAssignment (IAssignmentOperation operation, LocalDataFlowState<TValue, TContext, TValueLattice, TContextLattice> state)
DataFlow\LValueFlowCaptureProvider.cs (3)
41 static bool IsLValueFlowCapture (IFlowCaptureReferenceOperation flowCaptureReference, out IAssignmentOperation? assignment) 43 assignment = flowCaptureReference.Parent as IAssignmentOperation; 64 if (IsLValueFlowCapture (flowCaptureReference, out IAssignmentOperation? assignment)) {
IOperationExtensions.cs (1)
107 if (operation.Parent is IAssignmentOperation assignmentOperation &&
Microsoft.Analyzers.Extra (1)
AsyncCallInsideUsingBlockAnalyzer.cs (1)
107var assignmentTarget = ((IAssignmentOperation)operation).Target as ILocalReferenceOperation;
Microsoft.AspNetCore.App.Analyzers (3)
Authorization\AddAuthorizationBuilderAnalyzer.cs (2)
179if (propertyReferenceOperation.Parent is IAssignmentOperation { Target: IPropertyReferenceOperation targetProperty } 184if (propertyReferenceOperation.Parent is IAssignmentOperation { Value: IPropertyReferenceOperation valueProperty }
RouteHandlers\DetectAmbiguousRoutes.cs (1)
76IAssignmentOperation or
Microsoft.AspNetCore.Components.Analyzers (1)
ComponentParameterUsageAnalyzer.cs (1)
43if (context.Operation is IAssignmentOperation assignmentOperation)
Microsoft.AspNetCore.Components.SdkAnalyzers (1)
ComponentParameterUsageAnalyzer.cs (1)
43if (context.Operation is IAssignmentOperation assignmentOperation)
Microsoft.AspNetCore.Mvc.Api.Analyzers (1)
ActualApiResponseMetadataFactory.cs (1)
164if (child is not IAssignmentOperation assignmentOperation ||
Microsoft.CodeAnalysis (8)
Generated\Operations.Generated.cs (8)
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.
Microsoft.CodeAnalysis.CodeStyle (13)
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (2)
198if (value is IAssignmentOperation or 640if (unusedSymbolWriteOperation.Parent is IAssignmentOperation assignment &&
src\Analyzers\Core\Analyzers\UseThrowExpression\AbstractUseThrowExpressionDiagnosticAnalyzer.cs (4)
111out var expressionStatement, out var assignmentExpression)) 139private static bool ValueIsAccessed(SemanticModel semanticModel, IConditionalOperation ifOperation, IBlockOperation containingBlock, ISymbol localOrParameter, IExpressionStatementOperation expressionStatement, IAssignmentOperation assignmentExpression) 170[NotNullWhen(true)] out IAssignmentOperation? assignmentExpression) 184assignmentExpression = expressionStatement.Operation as IAssignmentOperation;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (2)
19=> operation.Parent is IAssignmentOperation assignmentOperation && 128if (operation.Parent is IAssignmentOperation assignmentOperation &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\LValueFlowCaptureProvider.cs (1)
56if (flowCaptureReference.Parent is IAssignmentOperation assignment &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (4)
30private PooledDictionary<IAssignmentOperation, PooledHashSet<(ISymbol, IOperation)>> _pendingWritesMap; 59_pendingWritesMap = PooledDictionary<IAssignmentOperation, PooledHashSet<(ISymbol, IOperation)>>.GetInstance(); 164if (operation.Parent is IAssignmentOperation assignmentOperation && 187private void ProcessPendingWritesForAssignmentTarget(IAssignmentOperation operation)
Microsoft.CodeAnalysis.CodeStyle.Fixes (7)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\InitializeParameterHelpersCore.cs (5)
88if (IsFieldOrPropertyAssignment(statement, containingType, out var assignmentExpression, out fieldOrProperty) && 142IAssignmentOperation assignmentExpression, IParameterSymbol parameter) 163public static bool IsFieldOrPropertyAssignment(IOperation statement, INamedTypeSymbol containingType, [NotNullWhen(true)] out IAssignmentOperation? assignmentExpression) 168[NotNullWhen(true)] out IAssignmentOperation? assignmentExpression, 172expressionStatement.Operation is IAssignmentOperation assignment)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\NullableHelpers.cs (2)
75if (operation is IAssignmentOperation assignmentOperation && 147IAssignmentOperation assignment => IsSymbolReferencedByOperation(assignment.Target),
Microsoft.CodeAnalysis.CSharp (2)
CSharpExtensions.cs (2)
805/// conversion is applied before the operator is applied to the result of this conversion and <see cref="IAssignmentOperation.Value"/>. 831/// conversion is applied after the operator is applied, before the result is assigned to <see cref="IAssignmentOperation.Target"/>.
Microsoft.CodeAnalysis.CSharp.CodeStyle (4)
src\Analyzers\CSharp\Analyzers\MakeStructFieldsWritable\CSharpMakeStructFieldsWritableDiagnosticAnalyzer.cs (2)
102var operationAssigmnent = (IAssignmentOperation)context.Operation;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
138if (operation?.Parent is IAssignmentOperation { Type.TypeKind: TypeKind.Dynamic })
src\Analyzers\CSharp\Analyzers\UseSystemThreadingLock\CSharpUseSystemThreadingLockDiagnosticAnalyzer.cs (1)
202if (fieldReferenceOperation.Parent is IAssignmentOperation assignment &&
Microsoft.CodeAnalysis.CSharp.Features (4)
src\Analyzers\CSharp\Analyzers\MakeStructFieldsWritable\CSharpMakeStructFieldsWritableDiagnosticAnalyzer.cs (2)
102var operationAssigmnent = (IAssignmentOperation)context.Operation;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
138if (operation?.Parent is IAssignmentOperation { Type.TypeKind: TypeKind.Dynamic })
src\Analyzers\CSharp\Analyzers\UseSystemThreadingLock\CSharpUseSystemThreadingLockDiagnosticAnalyzer.cs (1)
202if (fieldReferenceOperation.Parent is IAssignmentOperation assignment &&
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (2)
IOperation\IOperationTests_IConversionExpression.cs (2)
5293var iopTree = (IAssignmentOperation)model.GetOperation(assignment);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (36)
Semantics\DynamicTests.cs (32)
6695var operation = (IAssignmentOperation)model.GetOperation(assignment); 6804var operation = (IAssignmentOperation)model.GetOperation(assignment); 6914var operation = (IAssignmentOperation)model.GetOperation(assignment); 7011var operation = (IAssignmentOperation)model.GetOperation(assignment); 8307var operation = (IAssignmentOperation)model.GetOperation(assignment); 8416var operation = (IAssignmentOperation)model.GetOperation(assignment); 8525var operation = (IAssignmentOperation)model.GetOperation(assignment); 8635var operation = (IAssignmentOperation)model.GetOperation(assignment); 8744var operation = (IAssignmentOperation)model.GetOperation(assignment); 8813var operation = (IAssignmentOperation)model.GetOperation(assignment); 8885var operation = (IAssignmentOperation)model.GetOperation(assignment); 8941var operation = (IAssignmentOperation)model.GetOperation(assignment); 9031var operation = (IAssignmentOperation)model.GetOperation(assignment); 9122var operation = (IAssignmentOperation)model.GetOperation(assignment); 9212var operation = (IAssignmentOperation)model.GetOperation(assignment); 9268var operation = (IAssignmentOperation)model.GetOperation(assignment);
Semantics\ObjectAndCollectionInitializerTests.cs (4)
4243var operation = (IAssignmentOperation)model.GetOperation(assignment); 4297var operation = (IAssignmentOperation)model.GetOperation(assignment);
Microsoft.CodeAnalysis.Features (12)
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (1)
611IAssignmentOperation assignmentExpression, IParameterSymbol parameter)
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (2)
198if (value is IAssignmentOperation or 640if (unusedSymbolWriteOperation.Parent is IAssignmentOperation assignment &&
src\Analyzers\Core\Analyzers\UseThrowExpression\AbstractUseThrowExpressionDiagnosticAnalyzer.cs (4)
111out var expressionStatement, out var assignmentExpression)) 139private static bool ValueIsAccessed(SemanticModel semanticModel, IConditionalOperation ifOperation, IBlockOperation containingBlock, ISymbol localOrParameter, IExpressionStatementOperation expressionStatement, IAssignmentOperation assignmentExpression) 170[NotNullWhen(true)] out IAssignmentOperation? assignmentExpression) 184assignmentExpression = expressionStatement.Operation as IAssignmentOperation;
ValueTracking\ValueTracker.cs (2)
147IAssignmentOperation? assignmentOperation = null; 152assignmentOperation = operation as IAssignmentOperation;
ValueTracking\ValueTracker.OperationCollector.cs (3)
37IAssignmentOperation assignmentOperation => VisitAssignmentOperationAsync(assignmentOperation, cancellationToken), 98private Task VisitAssignmentOperationAsync(IAssignmentOperation assignmentOperation, CancellationToken cancellationToken) 132if (IsContainedIn<IReturnOperation>(operation) || IsContainedIn<IAssignmentOperation>(operation))
Microsoft.CodeAnalysis.Test.Utilities (4)
Compilation\TestOperationVisitor.cs (1)
1156private void VisitAssignment(IAssignmentOperation operation)
Diagnostics\CouldHaveMoreSpecificTypeAnalyzer.cs (1)
60if (operationContext.Operation is IAssignmentOperation assignment)
Diagnostics\FieldCouldBeReadOnlyAnalyzer.cs (1)
54if (operationContext.Operation is IAssignmentOperation assignment)
Diagnostics\LocalCouldBeConstAnalyzer.cs (1)
48if (operationContext.Operation is IAssignmentOperation assignment)
Microsoft.CodeAnalysis.VisualBasic (2)
VisualBasicExtensions.vb (2)
1435''' conversion is applied before the operator is applied to the result of this conversion and <see cref="IAssignmentOperation.Value"/>. 1457''' conversion is applied after the operator is applied, before the result is assigned to <see cref="IAssignmentOperation.Target"/>.
Microsoft.CodeAnalysis.Workspaces (14)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (2)
19=> operation.Parent is IAssignmentOperation assignmentOperation && 128if (operation.Parent is IAssignmentOperation assignmentOperation &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\LValueFlowCaptureProvider.cs (1)
56if (flowCaptureReference.Parent is IAssignmentOperation assignment &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (4)
30private PooledDictionary<IAssignmentOperation, PooledHashSet<(ISymbol, IOperation)>> _pendingWritesMap; 59_pendingWritesMap = PooledDictionary<IAssignmentOperation, PooledHashSet<(ISymbol, IOperation)>>.GetInstance(); 164if (operation.Parent is IAssignmentOperation assignmentOperation && 187private void ProcessPendingWritesForAssignmentTarget(IAssignmentOperation operation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\InitializeParameterHelpersCore.cs (5)
88if (IsFieldOrPropertyAssignment(statement, containingType, out var assignmentExpression, out fieldOrProperty) && 142IAssignmentOperation assignmentExpression, IParameterSymbol parameter) 163public static bool IsFieldOrPropertyAssignment(IOperation statement, INamedTypeSymbol containingType, [NotNullWhen(true)] out IAssignmentOperation? assignmentExpression) 168[NotNullWhen(true)] out IAssignmentOperation? assignmentExpression, 172expressionStatement.Operation is IAssignmentOperation assignment)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\NullableHelpers.cs (2)
75if (operation is IAssignmentOperation assignmentOperation && 147IAssignmentOperation assignment => IsSymbolReferencedByOperation(assignment.Target),