1 implementation of Instance
Microsoft.CodeAnalysis (1)
Generated\Operations.Generated.cs (1)
5340public IOperation? Instance { get; }
95 references to Instance
ILLink.RoslynAnalyzer (5)
DataFlow\LocalDataFlowVisitor.cs (5)
260 TValue instanceValue = Visit (propertyRef.Instance, state); 291 Visit (eventRef.Instance, state); 432 TValue instanceValue = Visit (eventReference.Instance, state); 610 TValue instanceValue = Visit (operation.Instance, state); 628 Visit (operation.Instance, state);
Microsoft.Analyzers.Extra (1)
AsyncCallInsideUsingBlockAnalyzer.cs (1)
173.Where(operation => ReferencesSymbol(operation.Instance, taskSymbol))
Microsoft.AspNetCore.Mvc.Api.Analyzers (3)
ApiActionsDoNotRequireExplicitModelValidationCheckAnalyzer.cs (3)
198if (propertyReference.Instance?.Kind != OperationKind.PropertyReference) 204var modelStatePropertyReference = (IPropertyReferenceOperation)propertyReference.Instance; 205if (modelStatePropertyReference.Instance?.Kind != OperationKind.InstanceReference)
Microsoft.CodeAnalysis (21)
Operations\ControlFlowGraphBuilder.cs (21)
6180if (!memberReference.Member.IsStatic && memberReference.Instance != null) 6182PushOperand(VisitRequired(memberReference.Instance)); 6232instance = (!fieldReference.Member.IsStatic && fieldReference.Instance != null) ? PopOperand() : null; 6237instance = (!eventReference.Member.IsStatic && eventReference.Instance != null) ? PopOperand() : null; 6242instance = (!propertyReference.Member.IsStatic && propertyReference.Instance != null) ? PopOperand() : null; 6394Debug.Assert(propertyReference.Instance != null); 6395Debug.Assert(propertyReference.Instance.Kind == OperationKind.InstanceReference); 6396Debug.Assert(((IInstanceReferenceOperation)propertyReference.Instance).ReferenceKind == InstanceReferenceKind.ImplicitReceiver); 6399propertyReference.Instance.Syntax, propertyReference.Instance.Type, IsImplicit(propertyReference.Instance)); 7126IOperation? visitedInstance = operation.Field.IsStatic ? null : Visit(operation.Instance); 7133IOperation? visitedInstance = operation.Method.IsStatic ? null : Visit(operation.Instance); 7141if (operation.Instance is IInstanceReferenceOperation instanceReference && 7160IOperation? instance = operation.Property.IsStatic ? null : operation.Instance; 7169IOperation? visitedInstance = operation.Event.IsStatic ? null : Visit(operation.Instance); 7298var eventReferenceInstance = eventReference.Event.IsStatic ? null : eventReference.Instance; 7352VisitInstanceWithArguments(operation.EventReference.Event.IsStatic ? null : operation.EventReference.Instance, operation.Arguments); 7998Debug.Assert(propertyReference.Instance != null); 7999Debug.Assert(propertyReference.Instance.Kind == OperationKind.InstanceReference); 8000Debug.Assert(((IInstanceReferenceOperation)propertyReference.Instance).ReferenceKind == InstanceReferenceKind.ImplicitReceiver);
Microsoft.CodeAnalysis.CodeStyle (6)
src\Analyzers\Core\Analyzers\MakeFieldReadonly\AbstractMakeFieldReadonlyDiagnosticAnalyzer.cs (1)
285if (fieldReference.Instance?.Kind != OperationKind.InstanceReference ||
src\Analyzers\Core\Analyzers\QualifyMemberAccess\AbstractQualifyMemberAccessDiagnosticAnalyzer.cs (1)
67AnalyzeOperation(context, memberReferenceOperation, memberReferenceOperation.Instance);
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (2)
676return fieldReference.Instance == null || fieldReference.Instance.Kind == OperationKind.InstanceReference;
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (1)
524Instance: null or IInstanceReferenceOperation
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticEquivalence.cs (1)
127=> operation is IMemberReferenceOperation { Instance.Kind: OperationKind.InstanceReference };
Microsoft.CodeAnalysis.CSharp.CodeStyle (8)
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (4)
291IsPotentiallyValueType(fieldReference.Instance)) 302IsPotentiallyValueType(propertyReference.Instance)) 322IsPotentiallyValueType(eventReference.Instance)) 349return IsPotentiallyMutatingMethod(owningMethod, methodRefOperation.Instance, methodRefOperation.Method);
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseIndexOperatorDiagnosticAnalyzer.cs (1)
131propertyReference.Instance,
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\Helpers.cs (2)
46propertyRef.Instance != null && 48CSharpSyntaxFacts.Instance.AreEquivalent(instance.Syntax, propertyRef.Instance.Syntax);
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (1)
549var instance = operation.Instance;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (6)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (6)
242Instance: IParameterReferenceOperation { Parameter: IParameterSymbol referencedParameter }, 248Instance: IParameterReferenceOperation { Parameter: IParameterSymbol referencedParameter }, 448{ Instance: IInstanceReferenceOperation, Field: IFieldSymbol field } 451{ Instance: IInstanceReferenceOperation, Property: IPropertySymbol property } 923var leftObject = GetReferencedSymbolObject(memberReference1.Instance!); 924var rightObject = GetReferencedSymbolObject(memberReference2.Instance!);
Microsoft.CodeAnalysis.CSharp.Features (15)
ImplementInterface\CSharpImplementExplicitlyCodeRefactoringProvider.cs (1)
107IMemberReferenceOperation memberReference => memberReference.Instance,
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (4)
291IsPotentiallyValueType(fieldReference.Instance)) 302IsPotentiallyValueType(propertyReference.Instance)) 322IsPotentiallyValueType(eventReference.Instance)) 349return IsPotentiallyMutatingMethod(owningMethod, methodRefOperation.Instance, methodRefOperation.Method);
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseIndexOperatorDiagnosticAnalyzer.cs (1)
131propertyReference.Instance,
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\Helpers.cs (2)
46propertyRef.Instance != null && 48CSharpSyntaxFacts.Instance.AreEquivalent(instance.Syntax, propertyRef.Instance.Syntax);
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (1)
549var instance = operation.Instance;
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (6)
242Instance: IParameterReferenceOperation { Parameter: IParameterSymbol referencedParameter }, 248Instance: IParameterReferenceOperation { Parameter: IParameterSymbol referencedParameter }, 448{ Instance: IInstanceReferenceOperation, Field: IFieldSymbol field } 451{ Instance: IInstanceReferenceOperation, Property: IPropertySymbol property } 923var leftObject = GetReferencedSymbolObject(memberReference1.Instance!); 924var rightObject = GetReferencedSymbolObject(memberReference2.Instance!);
Microsoft.CodeAnalysis.Features (6)
IntroduceVariable\AbstractIntroduceVariableService.cs (1)
370=> operation is IMemberReferenceOperation { Instance.Kind: OperationKind.InstanceReference };
src\Analyzers\Core\Analyzers\MakeFieldReadonly\AbstractMakeFieldReadonlyDiagnosticAnalyzer.cs (1)
285if (fieldReference.Instance?.Kind != OperationKind.InstanceReference ||
src\Analyzers\Core\Analyzers\QualifyMemberAccess\AbstractQualifyMemberAccessDiagnosticAnalyzer.cs (1)
67AnalyzeOperation(context, memberReferenceOperation, memberReferenceOperation.Instance);
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (2)
676return fieldReference.Instance == null || fieldReference.Instance.Kind == OperationKind.InstanceReference;
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (1)
524Instance: null or IInstanceReferenceOperation
Microsoft.CodeAnalysis.Test.Utilities (23)
Compilation\ControlFlowGraphVerifier.cs (1)
1894propertyReference.Instance == n &&
Compilation\OperationTreeVerifier.cs (4)
1040if (operation.Parent is IMemberReferenceOperation memberReference && memberReference.Instance == operation) 1059VisitInstance(operation.Instance); 1461Assert.Equal(OperationKind.InstanceReference, propertyReference.Instance.Kind); 1462Assert.Equal(InstanceReferenceKind.ImplicitReceiver, ((IInstanceReferenceOperation)propertyReference.Instance).ReferenceKind);
Compilation\TestOperationVisitor.cs (6)
659if (operation.Instance != null) 661children = new[] { operation.Instance }.Concat(additionalChildren); 666operation.Instance is IInstanceReferenceOperation) 668Assert.False(operation.Instance.IsImplicit, $"Implicit {nameof(IInstanceReferenceOperation)} on {operation.Syntax}"); 1054Assert.Equal(OperationKind.InstanceReference, propertyReference.Instance.Kind); 1055Assert.Equal(InstanceReferenceKind.ImplicitReceiver, ((IInstanceReferenceOperation)propertyReference.Instance).ReferenceKind);
Diagnostics\FieldCouldBeReadOnlyAnalyzer.cs (5)
116if (inConstructor && fieldReference.Instance != null) 118switch (fieldReference.Instance.Kind) 135if (fieldReference.Instance != null && fieldReference.Instance.Type.IsValueType) 137AssignTo(fieldReference.Instance, inConstructor, staticConstructorType, assignedToFields, mightBecomeReadOnlyFields);
Diagnostics\LocalCouldBeConstAnalyzer.cs (3)
126if (fieldReference.Instance != null && fieldReference.Instance.Type.IsValueType) 128AssignTo(fieldReference.Instance, assignedToLocals, mightBecomeConstLocals);
Diagnostics\OperationTestAnalyzer.cs (4)
1385receiver = ((IFieldReferenceOperation)operation).Instance; 1389receiver = ((IPropertyReferenceOperation)operation).Instance; 1393receiver = ((IEventReferenceOperation)operation).Instance; 1397receiver = ((IMethodReferenceOperation)operation).Instance;
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticEquivalence.cs (1)
127=> operation is IMemberReferenceOperation { Instance.Kind: OperationKind.InstanceReference };