64 overrides of IsStatic
Microsoft.CodeAnalysis.CSharp (64)
Lowering\IteratorRewriter\IteratorFinallyMethodSymbol.cs (1)
214public override bool IsStatic
Lowering\StateMachineRewriter\SynthesizedStateMachineProperty.cs (1)
124public override bool IsStatic
Symbols\AliasSymbol.cs (1)
175public override bool IsStatic
Symbols\AnonymousTypes\PublicSymbols\AnonymousManager.TypeOrDelegatePublicSymbol.cs (1)
181public sealed override bool IsStatic
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.FieldSymbol.cs (1)
136public override bool IsStatic
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.PropertySymbol.cs (1)
102public override bool IsStatic
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.SynthesizedMethodBase.cs (1)
64public sealed override bool IsStatic
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.TypeOrDelegateTemplateSymbol.cs (1)
220public sealed override bool IsStatic
Symbols\ArrayTypeSymbol.cs (1)
426public override bool IsStatic
Symbols\AssemblySymbol.cs (1)
233public sealed override bool IsStatic
Symbols\DiscardSymbol.cs (1)
29public override bool IsStatic => false;
Symbols\DynamicTypeSymbol.cs (1)
93public override bool IsStatic
Symbols\ErrorMethodSymbol.cs (1)
69public override bool IsStatic
Symbols\ErrorPropertySymbol.cs (1)
68public override bool IsStatic { get { return false; } }
Symbols\ErrorTypeSymbol.cs (1)
386public sealed override bool IsStatic
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (1)
829public override bool IsStatic => false;
Symbols\FunctionPointers\FunctionPointerTypeSymbol.cs (1)
83public override bool IsStatic => false;
Symbols\FunctionTypeSymbol.cs (1)
118public override bool IsStatic => false;
Symbols\LabelSymbol.cs (1)
76public override bool IsStatic
Symbols\LocalSymbol.cs (1)
158public sealed override bool IsStatic
Symbols\Metadata\PE\PEEventSymbol.cs (1)
320public override bool IsStatic
Symbols\Metadata\PE\PEFieldSymbol.cs (1)
572public override bool IsStatic
Symbols\Metadata\PE\PEMethodSymbol.cs (1)
596public override bool IsStatic => HasFlag(MethodAttributes.Static);
Symbols\Metadata\PE\PENamedTypeSymbol.cs (1)
1652public override bool IsStatic
Symbols\Metadata\PE\PEPropertySymbol.cs (1)
599public override bool IsStatic
Symbols\ModuleSymbol.cs (1)
125public sealed override bool IsStatic
Symbols\NamespaceSymbol.cs (1)
176public sealed override bool IsStatic
Symbols\ParameterSymbol.cs (1)
350public override bool IsStatic
Symbols\PointerTypeSymbol.cs (1)
38public override bool IsStatic
Symbols\RangeVariableSymbol.cs (1)
110public override bool IsStatic
Symbols\ReducedExtensionMethodSymbol.cs (1)
406public override bool IsStatic
Symbols\SignatureOnlyMethodSymbol.cs (1)
143public override bool IsStatic { get { return _isStatic; } }
Symbols\SignatureOnlyPropertySymbol.cs (1)
56public override bool IsStatic { get { return _isStatic; } }
Symbols\Source\FieldSymbolWithAttributesAndModifiers.cs (1)
45public sealed override bool IsStatic
Symbols\Source\LambdaSymbol.cs (1)
105public override bool IsStatic => _isStatic;
Symbols\Source\LocalFunctionSymbol.cs (1)
359public override bool IsStatic => (_declarationModifiers & DeclarationModifiers.Static) != 0;
Symbols\Source\SourceEventSymbol.cs (1)
378public sealed override bool IsStatic
Symbols\Source\SourceMemberContainerSymbol.cs (1)
841public override bool IsStatic => HasFlag(DeclarationModifiers.Static);
Symbols\Source\SourceMemberMethodSymbol.cs (1)
651public sealed override bool IsStatic
Symbols\Source\SourcePropertySymbolBase.cs (1)
563public override bool IsStatic
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListEnumeratorTypeSymbol.cs (1)
154public override bool IsStatic => false;
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListProperty.cs (1)
57public override bool IsStatic => false;
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListTypeSymbol.cs (1)
831public override bool IsStatic => false;
Symbols\Synthesized\SynthesizedContainer.cs (1)
152public override bool IsStatic => false;
Symbols\Synthesized\SynthesizedDelegateSymbol.cs (1)
233public override bool IsStatic
Symbols\Synthesized\SynthesizedEmbeddedAttributeSymbol.cs (1)
88public override bool IsStatic => false;
Symbols\Synthesized\SynthesizedEntryPointSymbol.cs (1)
181public override bool IsStatic
Symbols\Synthesized\SynthesizedFieldSymbolBase.cs (1)
176public override bool IsStatic
Symbols\Synthesized\SynthesizedGlobalMethodSymbol.cs (1)
274public override bool IsStatic
Symbols\Synthesized\SynthesizedHotReloadExceptionSymbol.cs (1)
97public override bool IsStatic => false;
Symbols\Synthesized\SynthesizedImplementationMethod.cs (1)
166public override bool IsStatic
Symbols\Synthesized\SynthesizedInlineArrayTypeSymbol.cs (1)
79public override bool IsStatic => false;
Symbols\Synthesized\SynthesizedInstanceConstructor.cs (1)
223public sealed override bool IsStatic
Symbols\Synthesized\SynthesizedInteractiveInitializerMethod.cs (1)
104public override bool IsStatic
Symbols\Synthesized\SynthesizedIntrinsicOperatorSymbol.cs (1)
352public override bool IsStatic
Symbols\Synthesized\SynthesizedPrivateImplementationDetailsType.cs (1)
68public override bool IsStatic => _privateImplementationDetails.IsSealed && _privateImplementationDetails.IsAbstract;
Symbols\Synthesized\SynthesizedSealedPropertyAccessor.cs (1)
101public override bool IsStatic
Symbols\Synthesized\SynthesizedStaticConstructor.cs (1)
237public override bool IsStatic
Symbols\TypeParameterSymbol.cs (1)
216public sealed override bool IsStatic
Symbols\Wrapped\WrappedEventSymbol.cs (1)
94public override bool IsStatic
Symbols\Wrapped\WrappedFieldSymbol.cs (1)
200public override bool IsStatic
Symbols\Wrapped\WrappedMethodSymbol.cs (1)
117public override bool IsStatic
Symbols\Wrapped\WrappedNamedTypeSymbol.cs (1)
153public override bool IsStatic
Symbols\Wrapped\WrappedPropertySymbol.cs (1)
116public override bool IsStatic
286 references to IsStatic
Microsoft.CodeAnalysis.CSharp (286)
Binder\Binder.IdentifierUsedAsValueFinder.cs (1)
291treatAsInstanceMemberAccess = !(symbol.IsStatic || symbol.Kind == SymbolKind.NamedType);
Binder\Binder.ValueChecks.cs (11)
1362Debug.Assert(!fieldSymbol.IsStatic); 1394if (fieldSymbol.IsStatic || fieldSymbol.ContainingType.IsReferenceType) 1412var fieldIsStatic = fieldSymbol.IsStatic; 1417fieldIsStatic == containing.IsStatic && 1477if (fieldSymbol.IsStatic || fieldSymbol.ContainingType.IsReferenceType) 1499if (fieldSymbol.IsStatic || fieldSymbol.ContainingType.IsReferenceType) 1524if (eventSymbol.IsStatic || eventSymbol.ContainingType.IsReferenceType) 3248int index = (checkingReceiver ? 6 : 0) + (field.IsStatic ? 3 : 0) + (kind == BindValueKind.RefReturn ? 0 : (RequiresRefOrOut(kind) ? 1 : 2)); 3410if (eventSymbol.IsStatic || eventSymbol.ContainingType.IsReferenceType) 4123if (fieldSymbol.IsStatic || !fieldSymbol.ContainingType.IsRefLikeType) 4833if (fieldSymbol.IsStatic || !fieldSymbol.ContainingType.IsRefLikeType)
Binder\Binder_Attributes.cs (1)
622invalidNamedArgument |= namedArgumentNameSymbol.IsStatic;
Binder\Binder_Await.cs (1)
159if (((FieldSymbol)containingMemberOrLambda).IsStatic)
Binder\Binder_Constraints.cs (1)
601else if (type.IsStatic)
Binder\Binder_Conversions.cs (6)
413if (conversion.Method is MethodSymbol method && method.IsStatic) 602IsStatic: true, 634IsStatic: true, 667IsStatic: true, 1856if (candidate is not MethodSymbol { IsStatic: true } method) 2919if (!method.IsStatic)
Binder\Binder_Expressions.cs (23)
38if (memberOpt?.IsStatic == true) 454if (field is { IsStatic: false, RefKind: RefKind.None, ContainingSymbol: SourceMemberContainerTypeSymbol { PrimaryConstructor: { } primaryConstructor } } && 1732this.ContainingMember() is { Kind: not SymbolKind.NamedType, IsStatic: false } && // We are in an instance member 2224this.ContainingMember() is not { Kind: not SymbolKind.NamedType, IsStatic: false } containingMember || // We are not in an instance member 2282bool locationIsInstanceMember = !containingMember.IsStatic && 2349if (containingMember.IsStatic) 2710bool hasErrors = !conversion.IsValid || targetType.IsStatic; 2739if (targetType.IsStatic) 5470if (type.IsStatic) 5508if (type.IsStatic) 8272left = ReplaceTypeOrValueReceiver(left, symbol.IsStatic || symbol.Kind == SymbolKind.NamedType, diagnostics); 8524var isEnumField = (fieldSymbol.IsStatic && type.IsEnumType()); 8593if (!fieldSymbol.IsStatic) 8685if (!propertySymbol.IsStatic) 8698if (symbol.IsStatic && (symbol.IsAbstract || symbol.IsVirtual)) 8748return !symbol.IsStatic && !(symbol is TypeSymbol) && 8767if (!eventSymbol.IsStatic) 9850receiver = ReplaceTypeOrValueReceiver(receiver, property.IsStatic, diagnostics); 10202!getMethod.IsStatic && 10492if (!m.IsStatic) continue; 10497if (m.IsStatic) continue; 10637if (!memberMethod.IsStatic) continue; 10642if (memberMethod.IsStatic) continue;
Binder\Binder_Operators.cs (4)
2384if (methodOpt?.ContainingType?.IsInterface == true && methodOpt.IsStatic) 2594if ((object)fieldSymbol == null || fieldSymbol.IsStatic || (object)receiver == null) 3199if (targetType.IsStatic) 3769if (targetType.IsStatic)
Binder\Binder_Patterns.cs (1)
751else if (patternType.IsStatic)
Binder\Binder_Statements.cs (5)
1339!(patternMethodSymbol.ParameterCount == 0 || patternMethodSymbol.IsStatic && patternMethodSymbol.ParameterCount == 1)) 1769var propertyIsStatic = propertySymbol.IsStatic; 1800(member as FieldSymbol)?.IsStatic == isStatic; 3760if (this.ContainingMember() is MethodSymbol { IsStatic: false } method) 3832else if (baseType.IsErrorType() || baseType.IsStatic)
Binder\DecisionDagBuilder.cs (1)
535int extensionExtra = method.IsStatic ? 1 : 0;
Binder\ForEachLoopBinder.cs (3)
1445if (result.IsStatic || result.DeclaredAccessibility != Accessibility.Public) 1649if (lookupSymbol.IsStatic || lookupSymbol.DeclaredAccessibility != Accessibility.Public || lookupSymbol.Kind != SymbolKind.Property) 1682moveNextMethodCandidate.Method.IsStatic || moveNextMethodCandidate.Method.DeclaredAccessibility != Accessibility.Public ||
Binder\LockBinder.cs (1)
120IsStatic: false,
Binder\PatternExplainer.cs (1)
653if (declaredMember is FieldSymbol { IsConst: true, IsStatic: true, DeclaredAccessibility: Accessibility.Public } field &&
Binder\Semantics\OverloadResolution\OverloadResolution.cs (1)
631if (result.Result.IsValid && !member.IsStatic)
Binder\WithUsingNamespacesAndTypesBinder.cs (2)
171if (!symbol.IsStatic || ((MethodSymbol)symbol).IsExtensionMethod) 185if (!symbol.IsStatic)
BoundTree\Constructors.cs (1)
61if (fieldSymbol.IsStatic ||
CodeGen\CodeGenerator_HasHome.cs (3)
250if (field.IsStatic) 252return containingSymbol is MethodSymbol { MethodKind: MethodKind.StaticConstructor } or FieldSymbol { IsStatic: true }; 256return (containingSymbol is MethodSymbol { MethodKind: MethodKind.Constructor } or FieldSymbol { IsStatic: false } or MethodSymbol { IsInitOnly: true }) &&
CodeGen\EmitAddress.cs (2)
369if (!fieldAccess.FieldSymbol.IsStatic) 445else if (fieldAccess.FieldSymbol.IsStatic)
CodeGen\EmitConversion.cs (2)
313var isStatic = receiver == null || (!isExtensionMethod && method.IsStatic); 354if (!method.IsStatic && method.IsMetadataVirtual() && !method.ContainingType.IsDelegateType() && !receiver.SuppressVirtualCalls)
CodeGen\EmitExpression.cs (11)
1132if (!field.IsVolatile && !field.IsStatic && fieldAccess.ReceiverOpt.Type.IsVerifierValue() && field.RefKind == RefKind.None) 1158if (field.IsStatic) 1247if (!field.IsStatic && EmitFieldLoadReceiverAddress(fieldAccess.ReceiverOpt)) 1301if (field.IsStatic || field.RefKind != RefKind.None) 1383if (!sym.ContainingSymbol.IsStatic) 1661Debug.Assert(method.IsStatic); 1827Debug.Assert(!method.IsStatic && !method.IsDefaultValueTypeConstructor() && method.RequiresInstanceReceiver); 2301if (!method.IsMetadataVirtual() || method.IsStatic) 2788else if (!left.FieldSymbol.IsStatic) 3290_builder.EmitOpCode(field.IsStatic ? ILOpCode.Stsfld : ILOpCode.Stfld); 4104if ((load.TargetMethod.IsAbstract || load.TargetMethod.IsVirtual) && load.TargetMethod.IsStatic)
CodeGen\EmitStatement.cs (1)
1157Debug.Assert(!left.FieldSymbol.IsStatic, "Not supported");
CodeGen\Optimizer.cs (3)
1102return !((BoundFieldAccess)lhs).FieldSymbol.IsStatic; 1168Debug.Assert(method.IsStatic); 1346if (!field.IsStatic)
Compilation\CSharpSemanticModel.cs (2)
3746if (containingMember.IsStatic) 4087if (ReferenceEquals(type, null) || type.IsStatic)
Compilation\InitializerSemanticModel.cs (1)
281type.IsNullableEnabledForConstructorsAndInitializers(useStatic: MemberSymbol.IsStatic);
Compiler\MethodBodySynthesizer.cs (1)
280field.IsStatic ? null : new BoundThisReference(syntax, accessor.ThisParameter.Type),
Compiler\MethodBodySynthesizer.Lowered.cs (1)
465BoundExpression invocation = F.Call(methodToInvoke.IsStatic ? null : (useBaseReference ? (BoundExpression)F.Base(baseType: methodToInvoke.ContainingType) : F.This()),
Emitter\Model\FieldSymbolAdapter.cs (1)
231return AdaptedFieldSymbol.IsStatic;
Emitter\Model\MethodSymbolAdapter.cs (1)
476return AdaptedMethodSymbol.IsStatic;
Emitter\Model\NamedTypeSymbolAdapter.cs (2)
1000return this.IsAbstract || this.IsStatic; 1009return this.IsSealed || this.IsStatic;
Emitter\NoPia\EmbeddedTypesManager.cs (1)
458(containerKind == TypeKind.Struct && (field.AdaptedFieldSymbol.IsStatic || field.AdaptedFieldSymbol.DeclaredAccessibility != Accessibility.Public)))
FlowAnalysis\AbstractFlowPass.cs (2)
1638return method.IsStatic && !method.IsExtensionMethod; 2235!fieldSymbol.IsStatic &&
FlowAnalysis\DefiniteAssignment.cs (8)
340case MethodSymbol { IsStatic: false, ContainingSymbol: SourceMemberContainerTypeSymbol { PrimaryConstructor: { } primaryConstructor } } and 356case (FieldSymbol or PropertySymbol) and { IsStatic: false, ContainingSymbol: SourceMemberContainerTypeSymbol { PrimaryConstructor: { } primaryConstructor } }: 1081if (fieldSymbol.IsStatic) 1093if (eventSymbol.IsStatic) 1112if (propSymbol.IsStatic) 1139!fieldSymbol.IsStatic && 1492if (fieldSymbol.ContainingType.IsReferenceType || fieldSymbol.IsStatic) return null; 1839if (!current.IsStatic &&
FlowAnalysis\EmptyStructTypeCache.cs (2)
140if (member.IsStatic) 179if (!includeStatic && member.IsStatic)
FlowAnalysis\NullableWalker.cs (19)
706if (member.IsStatic != isStatic) 802if (member.IsStatic != method.IsStatic) 895|| method.IsStatic 1130if (member.IsStatic) 1410Binder.BindFieldInitializers(compilation, null, method.IsStatic ? containingType.StaticInitializers : containingType.InstanceInitializers, BindingDiagnosticBag.Discarded, ref discardedInitializers); 1955if (fieldSymbol.IsStatic) 1968if (eventSymbol.IsStatic) 1980if (propSymbol.IsStatic) 2149&& constructor.IsStatic == symbol.IsStatic) 2151if ((constructor.IsStatic && containingSlot == 0 && constructor.ContainingType.Equals(symbol.ContainingType)) 2152|| (!constructor.IsStatic && containingSlot > 0 && _variables[containingSlot].Symbol is ThisParameterSymbol)) 7093int receiverSlot = receiverOpt is not null && !method.IsStatic 7115if (method.IsStatic) 7124if (container.IsStatic) 7187if (member.IsStatic) 7917if (!method.IsStatic) 11685if (!@event.IsStatic)
FlowAnalysis\ReadWriteWalker.cs (2)
104if (!current.IsStatic && 172if (expr.FieldSymbol.IsStatic) return;
Lowering\AsyncRewriter\AsyncMethodBuilderMemberCollection.cs (2)
485method.IsStatic && 513!property.IsStatic &&
Lowering\AsyncRewriter\AsyncMethodToStateMachineRewriter.cs (1)
425return methodSymbol.IsStatic
Lowering\ClosureConversion\ClosureConversion.cs (3)
849return (!_currentMethod.IsStatic && TypeSymbol.Equals(_currentMethod.ContainingType, _topLevelMethod.ContainingType, TypeCompareKind.ConsiderEverything2)) 1366Debug.Assert(node.TargetMethod is { RequiresInstanceReceiver: false, IsStatic: true }); 1381remappedMethod is { RequiresInstanceReceiver: false, IsStatic: true });
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (2)
810var receiver = node.FieldSymbol.IsStatic ? _bound.Null(ExpressionType) : Visit(node.ReceiverOpt); 1103var receiver = node.PropertySymbol.IsStatic ? _bound.Null(ExpressionType) : Visit(node.ReceiverOpt);
Lowering\ClosureConversion\SynthesizedClosureMethod.cs (1)
110Debug.Assert(!(originalMethod is LocalFunctionSymbol) || !originalMethod.IsStatic || IsStatic);
Lowering\DiagnosticsPass_ExpressionTrees.cs (8)
351else if ((method.IsAbstract || method.IsVirtual) && method.IsStatic) 511if (_inExpressionLambda && node.AddMethod.IsStatic) 552if (_inExpressionLambda && (property.IsAbstract || property.IsVirtual) && property.IsStatic) 710if (((binary.IsAbstract || binary.IsVirtual) && binary.IsStatic) || ((unary.IsAbstract || unary.IsVirtual) && unary.IsStatic)) 741if (_inExpressionLambda && node.MethodOpt is MethodSymbol method && (method.IsAbstract || method.IsVirtual) && method.IsStatic) 838if (_inExpressionLambda && node.Conversion.Method is MethodSymbol method && (method.IsAbstract || method.IsVirtual) && method.IsStatic) 888else if (method is not null && (method.IsAbstract || method.IsVirtual) && method.IsStatic)
Lowering\DiagnosticsPass_Warnings.cs (4)
136if (receiver == null || fieldAccess.FieldSymbol.IsStatic) 211(field1.FieldSymbol.IsStatic || IsSameLocalOrField(field1.ReceiverOpt, field2.ReceiverOpt)); 216(event1.EventSymbol.IsStatic || IsSameLocalOrField(event1.ReceiverOpt, event2.ReceiverOpt)); 260else if ((method.IsAbstract || method.IsVirtual) && method.IsStatic)
Lowering\InitializerRewriter.cs (1)
94var boundReceiver = field.IsStatic ? null :
Lowering\Instrumentation\ModuleCancellationInstrumenter.cs (2)
184if (member.IsStatic == methodDefinition.IsStatic &&
Lowering\LocalRewriter\DelegateCacheRewriter.cs (1)
41return targetMethod.IsStatic && !boundDelegateCreation.IsExtensionMethod;
Lowering\LocalRewriter\LocalRewriter.cs (4)
770if (_factory.CurrentFunction?.IsStatic == false) 925if (!lhsField.IsStatic && lhsField.ContainingType.IsStructType()) 1056if (eventAccess.EventSymbol.IsStatic) 1068if (!fieldAccess.FieldSymbol.IsStatic)
Lowering\LocalRewriter\LocalRewriter.DecisionDagRewriter.cs (1)
171!method.IsStatic &&
Lowering\LocalRewriter\LocalRewriter.PatternLocalRewriter.cs (1)
172if (method.IsStatic)
Lowering\LocalRewriter\LocalRewriter_Call.cs (3)
201Debug.Assert(receiverOpt is not BoundTypeExpression || method.IsStatic); 248if (invokedAsExtensionMethod && interceptor.IsStatic && !interceptor.IsExtensionMethod) 449if (method.IsStatic &&
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (1)
926else if (asSpanMethod is MethodSymbol { IsStatic: true, ParameterCount: 1 })
Lowering\LocalRewriter\LocalRewriter_CompoundAssignmentOperator.cs (2)
184if (receiverOpt == null || propertyOrEvent.IsStatic || !CanChangeValueBetweenReads(receiverOpt)) 464if (fieldOrEvent.IsStatic)
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (1)
556constrainedToTypeOpt: symbolOpt.IsStatic &&
Lowering\LocalRewriter\LocalRewriter_Event.cs (3)
91Debug.Assert(eventSymbol.IsStatic || rewrittenReceiverOpt is { }); 92if (!eventSymbol.IsStatic && CanChangeValueBetweenReads(rewrittenReceiverOpt!)) 243fieldSymbol.IsStatic ? null : rewrittenReceiver,
Lowering\LocalRewriter\LocalRewriter_FixedStatement.cs (1)
358var getPinnableCall = getPinnableMethod.IsStatic ?
Lowering\LocalRewriter\LocalRewriter_HostObjectMemberReference.cs (1)
14Debug.Assert(_factory.TopLevelMethod is { IsStatic: false });
Lowering\LocalRewriter\LocalRewriter_NullCoalescingOperator.cs (1)
201if (method.IsStatic && method.ContainingType.SpecialType == SpecialType.System_String)
Lowering\LocalRewriter\LocalRewriter_ObjectOrCollectionInitializerExpression.cs (1)
191Debug.Assert(addMethod.IsStatic);
Lowering\LocalRewriter\LocalRewriter_PreviousSubmissionReference.cs (1)
16Debug.Assert(_factory.TopLevelMethod is { IsStatic: false });
Lowering\LocalRewriter\LocalRewriter_Range.cs (2)
184Debug.Assert(constructionMethod.IsStatic); 193Debug.Assert(constructionMethod.IsStatic);
Lowering\LocalRewriter\LocalRewriter_StringConcat.cs (1)
173if (method.IsStatic && method.ContainingType.SpecialType == SpecialType.System_String)
Lowering\LocalRewriter\LocalRewriter_UnaryOperator.cs (1)
496return !((BoundFieldAccess)expression).FieldSymbol.IsStatic;
Lowering\MethodToClassRewriter.cs (1)
743Debug.Assert(!methodBeingWrapped.IsStatic);
Lowering\SpillSequenceSpiller.cs (3)
407if (fieldSymbol.IsStatic) 882if (field.FieldSymbol.IsStatic) break; 920if (!field.FieldSymbol.IsStatic)
Lowering\StateMachineRewriter\IteratorAndAsyncCaptureWalker.cs (2)
64if (!method.IsStatic && method.ContainingType.TypeKind == TypeKind.Struct) 242case BoundFieldAccess { FieldSymbol: { IsStatic: false, ContainingType: { IsValueType: true } }, ReceiverOpt: BoundExpression receiver }:
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (1)
602if (field.FieldSymbol.IsStatic)
Lowering\StateMachineRewriter\StateMachineRewriter.cs (3)
311if (!method.IsStatic) 444if (method.IsStatic || method.ThisParameter.Type.IsReferenceType) 466if (!method.IsStatic)
Lowering\SyntheticBoundNodeFactory.cs (7)
216Debug.Assert(CurrentFunction is { IsStatic: false }); 227Debug.Assert(CurrentFunction is { IsStatic: false }); 267Debug.Assert((receiverOpt is null) == property.IsStatic); 282Debug.Assert((receiverOpt is null) == property.IsStatic); 802Debug.Assert(methodSymbol.IsStatic); 810Debug.Assert(methodSymbol.IsStatic); 820Debug.Assert(methodSymbol.IsStatic);
Operations\CSharpOperationFactory.cs (6)
463if (targetMember.IsStatic && (targetMember.IsAbstract || targetMember.IsVirtual) && 602return boundObjectInitializerMember.MemberSymbol?.IsStatic == true ? 905IOperation? createReceiver() => memberSymbol?.IsStatic == true ? 1376if (operatorMethod is not null && operatorMethod.IsStatic && (operatorMethod.IsAbstract || operatorMethod.IsVirtual) && 2924=> symbol?.IsStatic == false ? new InstanceReferenceOperation(InstanceReferenceKind.PatternInput, _semanticModel, nameSyntax!, receiverType, isImplicit: true) : null; 2943Debug.Assert(!patternDisposeInfo.Method.IsStatic);
Operations\CSharpOperationFactory_Methods.cs (1)
106if (symbol != null && symbol.IsStatic && instance.WasCompilerGenerated && instance.Kind == BoundKind.ThisReference)
Symbols\AssemblySymbol.cs (1)
501return GetSpecialType(SpecialType.System_Runtime_CompilerServices_RuntimeFeature) is { TypeKind: TypeKind.Class, IsStatic: true } &&
Symbols\BaseTypeAnalysis.cs (1)
118if (fieldType is null || fieldType.TypeKind != TypeKind.Struct || field.IsStatic)
Symbols\Compilation_WellKnownMembers.cs (1)
295if (member.Kind != targetSymbolKind || member.IsStatic != isStatic ||
Symbols\ConstraintsHelper.cs (2)
1387if (m.IsStatic && m.IsImplementableInterfaceMember() && iface.FindImplementationForInterfaceMember(m) is null) 1398if (m.IsStatic && m.IsImplementableInterfaceMember() && iface.FindImplementationForInterfaceMember(m) is null)
Symbols\EventSymbol.cs (1)
81public virtual bool RequiresInstanceReceiver => !IsStatic;
Symbols\FieldSymbol.cs (1)
101public virtual bool RequiresInstanceReceiver => !IsStatic;
Symbols\MemberSignatureComparer.cs (1)
858return member.IsStatic ? 0 : Cci.CallingConvention.HasThis;
Symbols\MethodSymbol.cs (4)
91public virtual bool RequiresInstanceReceiver => !IsStatic; 369protected bool IsValidReadOnlyTarget => !IsStatic && ContainingType.IsStructType() && MethodKind != MethodKind.Constructor && !IsInitOnly; 719return IsStatic && !IsAbstract && !IsVirtual && Name == WellKnownMemberNames.EntryPointMethodName; 1040if (!IsStatic || IsAbstract || IsVirtual || MethodKind is not (MethodKind.Ordinary or MethodKind.LocalFunction))
Symbols\MethodSymbolExtensions.cs (1)
218return !method.IsStatic &&
Symbols\NamedTypeSymbol.cs (1)
701if (!symbol.IsStatic)
Symbols\OverriddenOrHiddenMembersHelpers.cs (1)
1022if (!method.IsMetadataVirtual(ignoreInterfaceImplementationChanges) || method.IsStatic)
Symbols\PropertySymbol.cs (1)
138public virtual bool RequiresInstanceReceiver => !IsStatic;
Symbols\PublicModel\Symbol.cs (1)
215get { return UnderlyingSymbol.IsStatic; }
Symbols\Retargeting\RetargetingSymbolTranslator.cs (2)
1024method.IsStatic, 1092property.IsStatic,
Symbols\Source\ExplicitInterfaceHelpers.cs (1)
368if (implementedMember.IsStatic && !implementingMember.ContainingAssembly.RuntimeSupportsStaticAbstractMembersInInterfaces)
Symbols\Source\SourceComplexParameterSymbol.cs (1)
1595if (addMethods[0].IsStatic) // No need to check other methods, extensions are never mixed with instance methods
Symbols\Source\SourceConstructorSymbol.cs (1)
175else if (ContainingType.IsStatic && methodKind == MethodKind.Constructor)
Symbols\Source\SourceEventSymbol.cs (1)
583else if (ContainingType.IsStatic && !IsStatic)
Symbols\Source\SourceMemberContainerSymbol.cs (12)
1389if (member.IsStatic) 2399if (field is null || field.IsStatic) 2699if (f is null || !f.IsStatic || f.Type.TypeKind != TypeKind.Struct) continue; 2728if (f is null || !f.IsStatic || f.Type.TypeKind != TypeKind.Struct) continue; 3384if (member.IsStatic || 4321if (deconstruct.IsStatic) 4545else if (existingMember is FieldSymbol { IsStatic: false } field 4554else if (existingMember is PropertySymbol { IsStatic: false, GetMethod: { } } prop 4762else if (symbol.IsStatic) 5036builder.UpdateIsNullableEnabledForConstructorsAndFields(useStatic: backingField.IsStatic, compilation, propertySyntax); 5094builder.UpdateIsNullableEnabledForConstructorsAndFields(useStatic: associatedField.IsStatic, compilation, declarator); 5098if (associatedField.IsStatic)
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (1)
1820if (!interfaceMethod.IsStatic)
Symbols\Source\SourceMemberFieldSymbol.cs (1)
53else if (type.IsStatic)
Symbols\Source\SourceMethodSymbolWithAttributes.cs (3)
744else if (this is { MethodKind: MethodKind.LocalFunction, IsStatic: false }) 822if (!implementationPart.IsExtern || !implementationPart.IsStatic) 960if (!IsStatic || ParameterCount > 0 || !ReturnsVoid || IsAbstract || IsVirtual)
Symbols\Source\SourceNamedTypeSymbol.cs (1)
1472if (!field.IsStatic)
Symbols\Source\SourceNamedTypeSymbol_Bases.cs (1)
383if (baseType.IsStatic)
Symbols\Source\SourceOrdinaryMethodSymbol.cs (3)
230else if (!ContainingType.IsScriptClass && !(ContainingType.IsStatic && ContainingType.Arity == 0)) 842else if (ReturnType.IsStatic) 896else if (ContainingType.IsStatic && !IsStatic)
Symbols\Source\SourcePropertySymbolBase.cs (2)
1120else if (ContainingType.IsStatic && !IsStatic) 1842if (type.IsStatic)
Symbols\Source\SourceUserDefinedOperatorSymbolBase.cs (3)
64if (this.ContainingType.IsStatic) 262if (returnType.Type.IsStatic) 281if (this.ContainingType.IsStatic)
Symbols\Symbol.cs (1)
1762get { return this.IsStatic; }
Symbols\Synthesized\Records\SynthesizedRecordClone.cs (1)
163IsStatic: false,
Symbols\Synthesized\Records\SynthesizedRecordCopyCtor.cs (2)
52if (!field.IsStatic) 146return member is MethodSymbol { IsStatic: false, ParameterCount: 1, Arity: 0 } method &&
Symbols\Synthesized\Records\SynthesizedRecordEqualityOperator.cs (1)
46candidate.ReturnType.SpecialType == SpecialType.System_Boolean && !candidate.IsStatic &&
Symbols\Synthesized\Records\SynthesizedRecordEquals.cs (2)
77if (_equalityContract.IsStatic || !_equalityContract.Type.Equals(DeclaringCompilation.GetWellKnownType(WellKnownType.System_Type), TypeCompareKind.AllIgnoreOptions)) 134if (!f.IsStatic)
Symbols\Synthesized\Records\SynthesizedRecordGetHashCode.cs (2)
64if (_equalityContract.IsStatic) 96if (!f.IsStatic)
Symbols\Synthesized\Records\SynthesizedRecordPrintMembers.cs (1)
326return m.DeclaredAccessibility == Accessibility.Public && !m.IsStatic;
Symbols\Synthesized\SynthesizedExplicitImplementationForwardingMethod.cs (1)
48public override bool IsStatic => _implementingMethod.IsStatic;
Symbols\Synthesized\SynthesizedInstanceMethodSymbol.cs (1)
47Debug.Assert(!IsStatic);
Symbols\TypeSymbol.cs (12)
913(!interfaceMember.IsStatic || implementingTypeIsFromSomeCompilation)) 1013else if (!interfaceMember.IsStatic) 1608interfaceMethod.IsStatic, 1625bool isStatic = implicitImpl.IsStatic; 1696else if (implicitImplMethod.IsStatic && implicitImplMethod.MethodKind == MethodKind.Ordinary && implicitImplMethod.GetUnmanagedCallersOnlyAttributeData(forceComplete: true) is not null) 1738if (implicitImpl.IsStatic && interfaceMember.ContainingModule != implementingType.ContainingModule) 1986if (closestMismatch.IsStatic != interfaceMember.IsStatic) 1988diagnostics.Add(closestMismatch.IsStatic ? ErrorCode.ERR_CloseUnimplementedInterfaceMemberStatic : ErrorCode.ERR_CloseUnimplementedInterfaceMemberNotStatic, 2235if (candidateMember.DeclaredAccessibility != Accessibility.Public || candidateMember.IsStatic != interfaceMember.IsStatic) 2525if (!field.IsStatic)
Symbols\TypeWithAnnotations.cs (2)
899internal override bool IsStatic(TypeSymbol typeSymbol) => typeSymbol.IsStatic; 972internal override bool IsStatic(TypeSymbol typeSymbol) => typeSymbol.IsStatic;
Symbols\VarianceSafety.cs (2)
174if (member.IsStatic && !member.IsAbstract && !member.IsVirtual) 472if (!(context is TypeSymbol) && context.IsStatic && !context.IsAbstract && !context.IsVirtual)
Symbols\Wrapped\WrappedEventSymbol.cs (1)
98return _underlyingEvent.IsStatic;
Symbols\Wrapped\WrappedFieldSymbol.cs (1)
204return _underlyingField.IsStatic;
Symbols\Wrapped\WrappedMethodSymbol.cs (1)
121return UnderlyingMethod.IsStatic;
Symbols\Wrapped\WrappedNamedTypeSymbol.cs (1)
157return _underlyingType.IsStatic;
Symbols\Wrapped\WrappedPropertySymbol.cs (1)
120return _underlyingProperty.IsStatic;