115 overrides of ContainingSymbol
Microsoft.CodeAnalysis.CSharp (115)
Binder\Binder.ValueChecks.cs (1)
3027public override Symbol ContainingSymbol
CodeGen\Optimizer.cs (1)
2386public override Symbol ContainingSymbol
FlowAnalysis\NullableWalker.PlaceholderLocal.cs (1)
49public override Symbol ContainingSymbol => _containingSymbol;
Lowering\ClosureConversion\SynthesizedClosureEnvironment.cs (1)
139public override Symbol ContainingSymbol => TopLevelMethod.ContainingSymbol;
Lowering\IteratorRewriter\IteratorFinallyMethodSymbol.cs (1)
199public override Symbol ContainingSymbol
Lowering\LocalRewriter\DelegateCacheContainer.cs (1)
40public override Symbol ContainingSymbol => _containingSymbol;
Lowering\LocalRewriter\DynamicSiteContainer.cs (1)
24public override Symbol ContainingSymbol
Lowering\StateMachineRewriter\StateMachineTypeSymbol.cs (1)
34public override Symbol ContainingSymbol
Lowering\StateMachineRewriter\SynthesizedStateMachineProperty.cs (1)
104public override Symbol ContainingSymbol
Symbols\AliasSymbol.cs (1)
206public sealed override Symbol ContainingSymbol
Symbols\AnonymousTypes\PublicSymbols\AnonymousManager.TypeOrDelegatePublicSymbol.cs (1)
57public sealed override Symbol ContainingSymbol
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.FieldSymbol.cs (1)
105public override Symbol ContainingSymbol
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.PropertySymbol.cs (1)
166public override Symbol ContainingSymbol
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.SynthesizedMethodBase.cs (1)
41public sealed override Symbol ContainingSymbol
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.TypeOrDelegateTemplateSymbol.cs (1)
135public sealed override Symbol ContainingSymbol
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.TypeParameterSymbol.cs (1)
127public override Symbol ContainingSymbol
Symbols\ArrayTypeSymbol.cs (1)
302public override Symbol? ContainingSymbol
Symbols\AssemblySymbol.cs (1)
300public sealed override Symbol ContainingSymbol
Symbols\DiscardSymbol.cs (1)
21public override Symbol? ContainingSymbol => null;
Symbols\DynamicTypeSymbol.cs (1)
167public override Symbol? ContainingSymbol
Symbols\ErrorMethodSymbol.cs (1)
104public override Symbol ContainingSymbol
Symbols\ErrorPropertySymbol.cs (1)
42public override Symbol ContainingSymbol { get { return _containingSymbol; } }
Symbols\ErrorTypeSymbol.cs (1)
241public override Symbol? ContainingSymbol
Symbols\ErrorTypeSymbol.ErrorTypeParameterSymbol.cs (1)
42public override Symbol ContainingSymbol
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (1)
817public override Symbol? ContainingSymbol => null;
Symbols\FunctionPointers\FunctionPointerParameterSymbol.cs (1)
29public override Symbol ContainingSymbol => _containingSymbol;
Symbols\FunctionPointers\FunctionPointerTypeSymbol.cs (1)
79public override Symbol? ContainingSymbol => null;
Symbols\FunctionTypeSymbol.cs (1)
110public override Symbol? ContainingSymbol => null;
Symbols\LabelSymbol.cs (1)
153public override Symbol ContainingSymbol
Symbols\MergedNamespaceSymbol.cs (1)
250public override Symbol ContainingSymbol
Symbols\Metadata\PE\PEEventSymbol.cs (1)
217public override Symbol ContainingSymbol
Symbols\Metadata\PE\PEFieldSymbol.cs (1)
162public override Symbol ContainingSymbol
Symbols\Metadata\PE\PEGlobalNamespaceSymbol.cs (1)
35public override Symbol ContainingSymbol
Symbols\Metadata\PE\PEMethodSymbol.cs (1)
444public override Symbol ContainingSymbol => _containingType;
Symbols\Metadata\PE\PEModuleSymbol.cs (1)
218public override Symbol ContainingSymbol
Symbols\Metadata\PE\PENamedTypeSymbol.cs (1)
607public override Symbol ContainingSymbol
Symbols\Metadata\PE\PENestedNamespaceSymbol.cs (1)
84public override Symbol ContainingSymbol
Symbols\Metadata\PE\PEParameterSymbol.cs (1)
513public override Symbol ContainingSymbol
Symbols\Metadata\PE\PEPropertySymbol.cs (1)
398public override Symbol ContainingSymbol
Symbols\Metadata\PE\PETypeParameterSymbol.cs (1)
138public override Symbol ContainingSymbol
Symbols\MissingModuleSymbol.cs (1)
89public override Symbol ContainingSymbol
Symbols\MissingNamespaceSymbol.cs (1)
48public override Symbol ContainingSymbol
Symbols\NativeIntegerTypeSymbol.cs (4)
42public override Symbol ContainingSymbol => _underlyingType.ContainingSymbol; 343public override Symbol ContainingSymbol => _container; 417public override Symbol ContainingSymbol => _container; 468public override Symbol ContainingSymbol => _container;
Symbols\PointerTypeSymbol.cs (1)
173public override Symbol? ContainingSymbol
Symbols\RangeVariableSymbol.cs (1)
135public override Symbol ContainingSymbol
Symbols\ReducedExtensionMethodSymbol.cs (2)
452public override Symbol ContainingSymbol 628public override Symbol ContainingSymbol
Symbols\Retargeting\RetargetingEventSymbol.cs (1)
132public override Symbol? ContainingSymbol
Symbols\Retargeting\RetargetingFieldSymbol.cs (1)
65public override Symbol ContainingSymbol
Symbols\Retargeting\RetargetingMethodSymbol.cs (1)
195public override Symbol ContainingSymbol
Symbols\Retargeting\RetargetingModuleSymbol.cs (1)
160public override Symbol ContainingSymbol
Symbols\Retargeting\RetargetingNamedTypeSymbol.cs (1)
214public override Symbol ContainingSymbol
Symbols\Retargeting\RetargetingNamespaceSymbol.cs (1)
145public override Symbol ContainingSymbol
Symbols\Retargeting\RetargetingParameterSymbol.cs (1)
63public sealed override Symbol ContainingSymbol
Symbols\Retargeting\RetargetingPropertySymbol.cs (1)
192public override Symbol ContainingSymbol
Symbols\Retargeting\RetargetingTypeParameterSymbol.cs (1)
55public override Symbol ContainingSymbol
Symbols\SignatureOnlyMethodSymbol.cs (1)
91public override Symbol ContainingSymbol { get { return _containingType; } }
Symbols\SignatureOnlyParameterSymbol.cs (1)
93public override Symbol ContainingSymbol { get { throw ExceptionUtilities.Unreachable(); } }
Symbols\SignatureOnlyPropertySymbol.cs (1)
62public override Symbol ContainingSymbol { get { return _containingType; } }
Symbols\Source\CrefTypeParameterSymbol.cs (1)
169public override Symbol ContainingSymbol
Symbols\Source\IndexedTypeParameterSymbol.cs (1)
184public override Symbol ContainingSymbol
Symbols\Source\LambdaSymbol.cs (1)
254public override Symbol ContainingSymbol
Symbols\Source\LocalFunctionSymbol.cs (1)
329public sealed override Symbol ContainingSymbol => _containingSymbol;
Symbols\Source\SourceEventSymbol.cs (1)
93public sealed override Symbol ContainingSymbol
Symbols\Source\SourceFieldSymbol.cs (1)
98public sealed override Symbol ContainingSymbol
Symbols\Source\SourceFixedFieldSymbol.cs (1)
163public override Symbol ContainingSymbol
Symbols\Source\SourceLocalSymbol.cs (1)
259public override Symbol ContainingSymbol
Symbols\Source\SourceMemberContainerSymbol.cs (1)
763public sealed override Symbol ContainingSymbol
Symbols\Source\SourceMemberMethodSymbol.cs (1)
492public sealed override Symbol ContainingSymbol
Symbols\Source\SourceModuleSymbol.cs (1)
431public override Symbol ContainingSymbol
Symbols\Source\SourceNamespaceSymbol.cs (1)
70public override Symbol ContainingSymbol
Symbols\Source\SourceParameterSymbolBase.cs (1)
57public sealed override Symbol ContainingSymbol
Symbols\Source\SourcePropertySymbolBase.cs (1)
503public override Symbol ContainingSymbol
Symbols\Source\SourceTypeParameterSymbol.cs (3)
479public override Symbol ContainingSymbol 626public override Symbol ContainingSymbol 889public override Symbol ContainingSymbol
Symbols\Source\ThisParameterSymbol.cs (1)
171public override Symbol ContainingSymbol
Symbols\SubstitutedEventSymbol.cs (1)
38public override Symbol ContainingSymbol
Symbols\SubstitutedFieldSymbol.cs (1)
38public override Symbol ContainingSymbol
Symbols\SubstitutedMethodSymbol.cs (1)
190public sealed override Symbol ContainingSymbol
Symbols\SubstitutedNamedTypeSymbol.cs (1)
122public sealed override Symbol ContainingSymbol
Symbols\SubstitutedParameterSymbol.cs (1)
40public override Symbol ContainingSymbol
Symbols\SubstitutedPropertySymbol.cs (1)
39public override Symbol ContainingSymbol
Symbols\SubstitutedTypeParameterSymbol.cs (1)
41public override Symbol ContainingSymbol
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListEnumeratorTypeSymbol.cs (1)
144public override Symbol ContainingSymbol => _containingType;
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListProperty.cs (1)
49public override Symbol ContainingSymbol => _containingType;
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListTypeParameterSymbol.cs (1)
45public override Symbol ContainingSymbol => _containingType;
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListTypeSymbol.cs (1)
821public override Symbol? ContainingSymbol => _containingModule.GlobalNamespace;
Symbols\Synthesized\Records\SynthesizedPrimaryConstructorParameterBackingFieldSymbol.cs (1)
62public override Symbol ContainingSymbol
Symbols\Synthesized\SynthesizedBackingFieldSymbol.cs (1)
148public override Symbol ContainingSymbol
Symbols\Synthesized\SynthesizedDelegateSymbol.cs (1)
213public override Symbol ContainingSymbol
Symbols\Synthesized\SynthesizedEmbeddedAttributeSymbol.cs (1)
76public override Symbol ContainingSymbol => _namespace;
Symbols\Synthesized\SynthesizedEntryPointSymbol.cs (1)
62public override Symbol ContainingSymbol
Symbols\Synthesized\SynthesizedFieldSymbolBase.cs (1)
145public override Symbol ContainingSymbol
Symbols\Synthesized\SynthesizedGlobalMethodSymbol.cs (1)
77public sealed override Symbol ContainingSymbol
Symbols\Synthesized\SynthesizedHotReloadExceptionSymbol.cs (1)
93public override Symbol ContainingSymbol => _namespace;
Symbols\Synthesized\SynthesizedImplementationMethod.cs (1)
115public sealed override Symbol ContainingSymbol
Symbols\Synthesized\SynthesizedInlineArrayTypeSymbol.cs (2)
69public override Symbol? ContainingSymbol => _containingModule.GlobalNamespace; 237public override Symbol ContainingSymbol => _container;
Symbols\Synthesized\SynthesizedInstanceConstructor.cs (1)
55public sealed override Symbol ContainingSymbol
Symbols\Synthesized\SynthesizedInteractiveInitializerMethod.cs (1)
54public override Symbol ContainingSymbol
Symbols\Synthesized\SynthesizedIntrinsicOperatorSymbol.cs (1)
312public override Symbol ContainingSymbol
Symbols\Synthesized\SynthesizedLocal.cs (1)
128public sealed override Symbol ContainingSymbol
Symbols\Synthesized\SynthesizedParameterSymbol.cs (1)
130public override Symbol? ContainingSymbol
Symbols\Synthesized\SynthesizedPrivateImplementationDetailsType.cs (1)
62public override Symbol ContainingSymbol => _globalNamespace;
Symbols\Synthesized\SynthesizedSealedPropertyAccessor.cs (1)
48public override Symbol ContainingSymbol
Symbols\Synthesized\SynthesizedStaticConstructor.cs (1)
22public override Symbol ContainingSymbol
Symbols\Synthesized\TypeSubstitutedLocalSymbol.cs (1)
57public override Symbol ContainingSymbol
Symbols\SynthesizedNamespaceSymbol.cs (1)
55public override Symbol ContainingSymbol
Symbols\SynthesizedSimpleMethodTypeParameterSymbol.cs (1)
91public override Symbol ContainingSymbol
Symbols\Tuples\TupleFieldSymbol.cs (1)
117public sealed override Symbol ContainingSymbol
Symbols\UpdatedContainingSymbolLocal.cs (1)
40public override Symbol ContainingSymbol { get; }
218 references to ContainingSymbol
Microsoft.CodeAnalysis.CSharp (218)
Binder\Binder.CapturedParametersFinder.cs (1)
155if (candidate is ParameterSymbol parameter && parameter.ContainingSymbol == (object)_primaryConstructor)
Binder\Binder.ValueChecks.cs (3)
1135parameterSymbol.ContainingSymbol is SynthesizedPrimaryConstructor primaryConstructor && 2993Debug.Assert(underlyingParameter.ContainingSymbol is MethodSymbol); 3029get { return _underlyingParameter.ContainingSymbol; }
Binder\Binder_Constraints.cs (4)
410Symbol containingSymbol = typeParameter.ContainingSymbol; 465MethodSymbol method => (TypeSymbol)method.ContainingSymbol, 556typeWithAnnotations.DefaultType is TypeParameterSymbol typeParameterInConstraint && typeParameterInConstraint.ContainingSymbol == (object)typeParameter.ContainingSymbol)
Binder\Binder_Expressions.cs (14)
454if (field is { IsStatic: false, RefKind: RefKind.None, ContainingSymbol: SourceMemberContainerTypeSymbol { PrimaryConstructor: { } primaryConstructor } } && 487var binder = new LocalScopeBinder(this.WithContainingMemberOrLambda(parameter.ContainingSymbol).WithAdditionalFlags(BinderFlags.ParameterDefaultValue)); 489parameter.ContainingSymbol, 1730if (symbol.ContainingSymbol is NamedTypeSymbol { OriginalDefinition: var symbolContainerDefinition } && 1774shadowedParameter.ContainingSymbol == (object)primaryConstructor) 1938if ((object)containingMethod != null && (object)symbol.ContainingSymbol != (object)containingMethod) 1941Debug.Assert(!symbol.ContainingSymbol.Equals(containingMethod)); 2078var primaryCtor = parameter.ContainingSymbol as SynthesizedPrimaryConstructor; 2225(object)containingMember.ContainingSymbol != primaryCtor.ContainingSymbol); // The member doesn't belong to our type, i.e. from nested type 2230if (symbol.ContainingSymbol is SynthesizedSimpleProgramEntryPointSymbol && 2357containingMember = containingMember.ContainingSymbol; 2497if (thisSymbol is not null && thisSymbol.ContainingSymbol != ContainingMemberOrLambda && thisSymbol.RefKind != RefKind.None) 3171if ((InConstructorInitializer || InFieldInitializer) && ContainingMemberOrLambda.ContainingSymbol.Kind == SymbolKind.NamedType) 5098parameter.ContainingSymbol == (object)primaryConstructor)
Binder\Binder_Lookup.cs (3)
661x = x.ContainingSymbol; 662y = y.ContainingSymbol; 1652for (Symbol s = symbol; (object)s != null; s = s.ContainingSymbol)
Binder\Binder_NameConflicts.cs (2)
25=> symbol.TryGetFirstLocation() ?? symbol.ContainingSymbol.GetFirstLocation(); 143return containingMemberOrLambda.ContainingSymbol?.Kind == SymbolKind.NamedType &&
Binder\Binder_Operators.cs (1)
2654if (parameterSymbol.ContainingSymbol is SynthesizedPrimaryConstructor primaryConstructor &&
Binder\Binder_Patterns.cs (3)
887if ((InConstructorInitializer || InFieldInitializer) && ContainingMemberOrLambda.ContainingSymbol.Kind == SymbolKind.NamedType) 952type.ContainingSymbol is var declContainer && declContainer.Kind == SymbolKind.Namespace && declContainer.Name == "System" && 953(declContainer.ContainingSymbol as NamespaceSymbol)?.IsGlobalNamespace == true;
Binder\Binder_Symbols.cs (5)
1508if (colorColorValueReceiver is BoundParameter { ParameterSymbol: { ContainingSymbol: SynthesizedPrimaryConstructor primaryConstructor } parameter } && 1890if (aLocationsCount == 0 && bLocationsCount == 0) return Compare(fst.ContainingSymbol, snd.ContainingSymbol); 1894int containerResult = Compare(fst.ContainingSymbol, snd.ContainingSymbol);
Binder\BinderFactory.cs (1)
129if (memberOpt is { ContainingSymbol: SourceMemberContainerTypeSymbol container })
Binder\ContextualAttributeBinder.cs (1)
54for (; (object)symbol != null; symbol = symbol.ContainingSymbol)
Binder\LocalBinderFactory.cs (2)
327switch (parameter.ContainingSymbol) 341switch (typeParameter.ContainingSymbol)
Binder\RefSafetyAnalysis.cs (2)
178Debug.Assert(_localEscapeScopes?.ContainsKey(local) == true || _symbol != local.ContainingSymbol); 430_symbol != node.LocalSymbol.ContainingSymbol);
Binder\Semantics\AccessCheck.cs (1)
80symbol = symbol.ContainingSymbol;
Binder\Semantics\Conversions\ConversionsBase.cs (1)
3243ContainingSymbol: { Kind: SymbolKind.Namespace },
BoundTree\BoundInlineArrayAccess.cs (4)
22ContainingSymbol: NamespaceSymbol 25ContainingSymbol: NamespaceSymbol { IsGlobalNamespace: true } 52ContainingSymbol: NamespaceSymbol 55ContainingSymbol: NamespaceSymbol { IsGlobalNamespace: true }
CodeGen\CodeGenerator_HasHome.cs (2)
75if (!IsAnyReadOnly(addressKind) && containingSymbol is MethodSymbol { ContainingSymbol: NamedTypeSymbol, IsEffectivelyReadOnly: true }) 245if (!TypeSymbol.Equals(field.ContainingType, containingSymbol.ContainingSymbol as NamedTypeSymbol, TypeCompareKind.AllIgnoreOptions))
CodeGen\EmitExpression.cs (1)
1383if (!sym.ContainingSymbol.IsStatic)
Compilation\CSharpCompilation.cs (2)
3609Debug.Assert(symbol.ContainingSymbol.Kind == SymbolKind.Namespace); // avoid unnecessary traversal of nested types 4744symbol = symbol.ContainingSymbol;
Compiler\ClsComplianceChecker.cs (1)
680Symbol container = parameters[0].ContainingSymbol;
Compiler\DocumentationCommentCompiler.cs (1)
1197if (!parameter.ContainingSymbol.IsAccessor() && !documentedParameters.Add(parameter))
Compiler\DocumentationCommentCompiler.IncludeElementExpander.cs (2)
552Symbol containingSymbol = memberSymbol.ContainingSymbol; 606currentSymbol = currentSymbol.ContainingSymbol;
DocumentationComments\DocumentationCommentIDVisitor.PartVisitor.cs (4)
153Symbol containingSymbol = symbol.ContainingSymbol; 178if ((object)symbol.ContainingSymbol != null && symbol.ContainingSymbol.Name.Length != 0) 180Visit(symbol.ContainingSymbol, builder);
Emitter\EditAndContinue\CSharpSymbolMatcher.cs (3)
248var otherContainer = Visit(@namespace.ContainingSymbol); 320var otherContainer = this.Visit(sourceType.ContainingSymbol); 438var otherContainer = Visit(symbol.ContainingSymbol);
Emitter\Model\PEModuleBuilder.cs (1)
1393var container = param.ContainingSymbol;
Emitter\Model\TypeParameterSymbolAdapter.cs (8)
65if (AdaptedTypeParameterSymbol.ContainingSymbol.Kind == SymbolKind.Method) 80if (AdaptedTypeParameterSymbol.ContainingSymbol.Kind == SymbolKind.Method) 100if (AdaptedTypeParameterSymbol.ContainingSymbol.Kind == SymbolKind.NamedType) 115if (AdaptedTypeParameterSymbol.ContainingSymbol.Kind == SymbolKind.NamedType) 222return ((MethodSymbol)AdaptedTypeParameterSymbol.ContainingSymbol).GetCciAdapter(); 231return ((NamedTypeSymbol)AdaptedTypeParameterSymbol.ContainingSymbol).GetCciAdapter(); 347return ((MethodSymbol)AdaptedTypeParameterSymbol.ContainingSymbol).GetCciAdapter(); 356return ((NamedTypeSymbol)AdaptedTypeParameterSymbol.ContainingSymbol).GetCciAdapter();
FlowAnalysis\DataFlowsOutWalker.cs (1)
234param.ContainingSymbol is SynthesizedPrimaryConstructor); // Primary constructor parameter can be used in other initializers and methods
FlowAnalysis\DefiniteAssignment.cs (6)
340case MethodSymbol { IsStatic: false, ContainingSymbol: SourceMemberContainerTypeSymbol { PrimaryConstructor: { } primaryConstructor } } and 356case (FieldSymbol or PropertySymbol) and { IsStatic: false, ContainingSymbol: SourceMemberContainerTypeSymbol { PrimaryConstructor: { } primaryConstructor } }: 689!(captured is ParameterSymbol { ContainingSymbol: SynthesizedPrimaryConstructor primaryConstructor } parameter && 746if (symbol is ParameterSymbol { ContainingSymbol: SynthesizedPrimaryConstructor } parameter) 1837Symbol containing = current.ContainingSymbol; 1945if (!parameter.IsThis && parameter.RefKind != RefKind.Out && parameter.ContainingSymbol is SynthesizedPrimaryConstructor primaryCtor)
FlowAnalysis\DefiniteAssignment.LocalFunctions.cs (1)
167symbol = symbol.ContainingSymbol;
FlowAnalysis\EmptyStructTypeCache.cs (1)
254for (; symbol != null && symbol.Kind != SymbolKind.Namespace; symbol = symbol.ContainingSymbol)
FlowAnalysis\NullableWalker.cs (9)
2168var container = method.ContainingSymbol; 2186if (symbol is ParameterSymbol { ContainingSymbol: SynthesizedPrimaryConstructor primaryConstructor } parameter && 2195enclosingMemberMethod = enclosingMemberMethod.ContainingSymbol as MethodSymbol; 2199methodThisParameter?.ContainingSymbol.ContainingSymbol == (object)primaryConstructor.ContainingSymbol && 2303var containingSymbol = parameterOpt?.ContainingSymbol; 6659if (parameter.ContainingSymbol.GetTypeOrReturnType().Type.SpecialType != SpecialType.System_Boolean) 7182while (current.ContainingSymbol is MethodSymbol container) 10150parameter.ContainingSymbol is not SynthesizedPrimaryConstructor primaryConstructor || !primaryConstructor.GetCapturedParameters().ContainsKey(parameter):
FlowAnalysis\NullableWalker.Variables.cs (2)
217Debug.Assert(!(method.ContainingSymbol is MethodSymbol containingMethod) || 359if (symbol.ContainingSymbol is MethodSymbol method &&
FlowAnalysis\ReadWriteWalker.cs (1)
102Symbol containing = current.ContainingSymbol;
Lowering\ClosureConversion\ClosureConversion.Analysis.Tree.cs (3)
632Debug.Assert(symbol.ContainingSymbol != null); 633if (symbol.ContainingSymbol != _currentFunction.OriginalMethodSymbol) 641while (function != null && symbol.ContainingSymbol != function.OriginalMethodSymbol)
Lowering\ClosureConversion\SynthesizedClosureEnvironment.cs (1)
139public override Symbol ContainingSymbol => TopLevelMethod.ContainingSymbol;
Lowering\LocalRewriter\DelegateCacheRewriter.cs (2)
142for (Symbol? enclosingSymbol = currentFunction; enclosingSymbol is MethodSymbol enclosingMethod; enclosingSymbol = enclosingSymbol.ContainingSymbol) 176for (Symbol? enclosingSymbol = currentFunction; enclosingSymbol is MethodSymbol enclosingMethod; enclosingSymbol = enclosingSymbol.ContainingSymbol)
Lowering\LocalRewriter\DynamicSiteContainer.cs (1)
26get { return _topLevelMethod.ContainingSymbol; }
Lowering\LocalRewriter\LocalRewriter.cs (1)
314if (node.ParameterSymbol.ContainingSymbol is SynthesizedPrimaryConstructor primaryCtor &&
Lowering\LocalRewriter\LocalRewriter_Call.cs (1)
623return expression is BoundParameter { ParameterSymbol: { ContainingSymbol: SynthesizedPrimaryConstructor primaryCtor } parameter } &&
Lowering\StateMachineRewriter\IteratorAndAsyncCaptureWalker.cs (3)
111Debug.Assert(!allVariables.Any((s, method) => s.Symbol is ParameterSymbol { ContainingSymbol: var container } && container != method && container is not SynthesizedPrimaryConstructor, method)); 121!(symbol is ParameterSymbol { ContainingSymbol: var container } && container != method)) // Not interested in force hoisting parameters that do not belong to our method 287if (node.ParameterSymbol.ContainingSymbol == topLevelMethod)
Symbols\AnonymousTypes\AnonymousTypeManager.Templates.cs (4)
388var xOwner = x.ContainingSymbol; 389var yOwner = y.ContainingSymbol; 407var other = symbol.ContainingSymbol; 414other = other.ContainingSymbol;
Symbols\Compilation_WellKnownMembers.cs (2)
1192if (typeParam.ContainingSymbol.Kind != SymbolKind.Method) 1206if (typeParam.ContainingSymbol.Kind != SymbolKind.NamedType)
Symbols\ConstraintsHelper.cs (5)
173if (constraintTypeParameter.ContainingSymbol == typeParameter.ContainingSymbol) 245if (underlyingTypeParameter.ContainingSymbol == typeParameter.ContainingSymbol) 1042Debug.Assert(ReferenceEquals(typeParameter.ContainingSymbol, containingSymbol.OriginalDefinition));
Symbols\ConstructedMethodSymbol.cs (1)
19: base(containingSymbol: constructedFrom.ContainingSymbol,
Symbols\ConstructedNamedTypeSymbol.cs (1)
63: base(newContainer: constructedFrom.ContainingSymbol,
Symbols\EventSymbol.cs (1)
263Debug.Assert(ReferenceEquals(newOwner.OriginalDefinition, this.ContainingSymbol.OriginalDefinition));
Symbols\FieldSymbol.cs (1)
330Debug.Assert(ReferenceEquals(newOwner.OriginalDefinition, this.ContainingSymbol.OriginalDefinition));
Symbols\Metadata\PE\PENamedTypeSymbol.cs (1)
376s = s.ContainingSymbol;
Symbols\Metadata\PE\PEParameterSymbol.cs (1)
316var accessSymbol = containingSymbol.Kind == SymbolKind.Property ? containingSymbol.ContainingSymbol : containingSymbol;
Symbols\MethodSymbol.cs (2)
890Debug.Assert(ReferenceEquals(newOwner.OriginalDefinition, this.ContainingSymbol.OriginalDefinition)); 1064method = method.ContainingSymbol as MethodSymbol;
Symbols\ModuleSymbol.cs (1)
43return (AssemblySymbol)ContainingSymbol;
Symbols\NamedTypeSymbol.cs (3)
118return this.ContainingSymbol as NamedTypeSymbol; 1350Debug.Assert(ReferenceEquals(newOwner.OriginalDefinition, this.ContainingSymbol.OriginalDefinition)); 1634ContainingSymbol?.Kind == SymbolKind.Namespace &&
Symbols\NativeIntegerTypeSymbol.cs (2)
42public override Symbol ContainingSymbol => _underlyingType.ContainingSymbol; 82Debug.Assert(_underlyingType.Equals(underlyingMember.ContainingSymbol));
Symbols\ObsoleteAttributeHelpers.cs (1)
91symbol = symbol.ContainingSymbol;
Symbols\ParameterSymbol.cs (1)
164(refKind == RefKind.Ref && ContainingSymbol.ContainingType.IsComImport));
Symbols\PropertySymbol.cs (1)
382Debug.Assert(ReferenceEquals(newOwner.OriginalDefinition, this.ContainingSymbol.OriginalDefinition));
Symbols\PublicModel\Symbol.cs (1)
67return UnderlyingSymbol.ContainingSymbol.GetPublicSymbol();
Symbols\ReducedExtensionMethodSymbol.cs (2)
264if (reducedFromTypeParameter.ContainingSymbol != _reducedFrom) 454get { return _reducedFrom.ContainingSymbol; }
Symbols\Retargeting\RetargetingEventSymbol.cs (1)
136return this.RetargetingTranslator.Retarget(_underlyingEvent.ContainingSymbol);
Symbols\Retargeting\RetargetingFieldSymbol.cs (1)
69return this.RetargetingTranslator.Retarget(_underlyingField.ContainingSymbol);
Symbols\Retargeting\RetargetingMethodSymbol.cs (1)
199return this.RetargetingTranslator.Retarget(_underlyingMethod.ContainingSymbol);
Symbols\Retargeting\RetargetingNamedTypeSymbol.cs (2)
218return this.RetargetingTranslator.Retarget(_underlyingType.ContainingSymbol); 260Debug.Assert((object)_underlyingType == underlyingResult.ContainingSymbol);
Symbols\Retargeting\RetargetingNamespaceSymbol.cs (1)
149return this.RetargetingTranslator.Retarget(_underlyingNamespace.ContainingSymbol);
Symbols\Retargeting\RetargetingParameterSymbol.cs (1)
67return this.RetargetingModule.RetargetingTranslator.Retarget(_underlyingParameter.ContainingSymbol);
Symbols\Retargeting\RetargetingPropertySymbol.cs (1)
196return this.RetargetingTranslator.Retarget(_underlyingProperty.ContainingSymbol);
Symbols\Retargeting\RetargetingSymbolTranslator.cs (3)
322if (type.ContainingSymbol.Kind != SymbolKind.NamedType && 1048Debug.Assert((object)typeParameter.ContainingSymbol == _toFind); 1060if ((object)containingType == typeParameter.ContainingSymbol)
Symbols\Retargeting\RetargetingTypeParameterSymbol.cs (1)
59return this.RetargetingTranslator.Retarget(_underlyingTypeParameter.ContainingSymbol);
Symbols\Source\LocalFunctionSymbol.cs (3)
441if (tpEnclosing.ContainingSymbol.Kind == SymbolKind.Method) 448Debug.Assert(tpEnclosing.ContainingSymbol.Kind == SymbolKind.NamedType); 452diagnostics.Add(typeError, location, name, tpEnclosing.ContainingSymbol);
Symbols\Source\ParameterHelpers.cs (2)
196parameter.RefKind, parameter.ContainingSymbol, thisKeyword, paramsKeyword, firstDefault, diagnostics); 907for (Symbol current = symbol; (object)current != null; current = current.ContainingSymbol)
Symbols\Source\SourceAssemblySymbol.cs (1)
2840string fullEmittedName = MetadataHelpers.BuildQualifiedName(originalDefinition.ContainingSymbol.ToDisplayString(SymbolDisplayFormat.QualifiedNameOnlyFormat),
Symbols\Source\SourceComplexParameterSymbol.cs (1)
1649if (ContainingSymbol.ContainingSymbol is NamedTypeSymbol) // No need to check for lambdas or local function
Symbols\Source\SourceMethodSymbol.cs (1)
44if (ContainingSymbol is SourceMethodSymbol method)
Symbols\Source\SourceMethodSymbolWithAttributes.cs (3)
425if (ContainingSymbol is SourceMemberContainerTypeSymbol { AnyMemberHasAttributes: false }) 834for (MethodSymbol? current = this; current is object; current = current.ContainingSymbol as MethodSymbol) 1475if (ContainingSymbol is NamedTypeSymbol { IsComImport: true, TypeKind: TypeKind.Class or TypeKind.Interface })
Symbols\Source\SourceTypeParameterSymbol.cs (8)
128var sourceMethod = this.ContainingSymbol as SourceOrdinaryMethodSymbol; 183var sourceMethod = this.ContainingSymbol as SourceOrdinaryMethodSymbol; 189binderOpt: (ContainingSymbol as LocalFunctionSymbol)?.WithTypeParametersBinder); 224Debug.Assert(!inProgress.Any() || ReferenceEquals(inProgress.Head.ContainingSymbol, this.ContainingSymbol)); 287switch (this.ContainingSymbol) 297throw ExceptionUtilities.UnexpectedValue(this.ContainingSymbol); 368Debug.Assert(this.ContainingSymbol.IsContainingSymbolOfAllTypeParameters(this.EffectiveBaseClassNoUseSiteDiagnostics)); 369Debug.Assert(this.ContainingSymbol.IsContainingSymbolOfAllTypeParameters(this.DeducedBaseTypeNoUseSiteDiagnostics));
Symbols\Source\SourceUserDefinedOperatorSymbolBase.cs (1)
705(object)p.ContainingSymbol == containingType &&
Symbols\Source\TypeParameterConstraintClause.cs (4)
169Symbol container = thisTypeParameter.ContainingSymbol; 176if (type is TypeParameterSymbol typeParameter && (object)typeParameter.ContainingSymbol == (object)container) 229Symbol container = thisTypeParameter.ContainingSymbol; 238if ((object)typeParameter.ContainingSymbol == (object)container)
Symbols\SubstitutedTypeParameterSymbol.cs (1)
56ContainingSymbol.OriginalDefinition != _underlyingTypeParameter.ContainingSymbol.OriginalDefinition ? this :
Symbols\Symbol.cs (13)
118Symbol container = this.ContainingSymbol; 149for (var container = this.ContainingSymbol; (object)container != null; container = container.ContainingSymbol) 172var container = this.ContainingSymbol; 218return ContainingSymbol?.DeclaringCompilation; 311ISymbolInternal ISymbolInternal.ContainingSymbol => this.ContainingSymbol; 343var container = this.ContainingSymbol; 937return this.ContainingSymbol.IsDefinedInSourceTree(tree, definedWithinSpan, cancellationToken); 1023if (ContainingSymbol is SourceMemberContainerTypeSymbol container) 1618return GetLocalNullableContextValue() ?? ContainingSymbol?.GetNullableContextValue(); 1693byte containingValue = ContainingSymbol?.GetNullableContextValue() ?? 0; 1746for (var currentFunction = variable.ContainingSymbol; 1748currentFunction = currentFunction.ContainingSymbol)
Symbols\Symbol_Attributes.cs (1)
957this.ContainingSymbol?.ForceCompleteObsoleteAttribute();
Symbols\SymbolExtensions.cs (6)
131var containingSymbol = symbol.ContainingSymbol; 151containingMember = containingMember.ContainingSymbol; 172symbol = method.ContainingSymbol; 253var symbol = type.ContainingSymbol; 254for (; ((object?)containingSymbol != null) && (containingSymbol.Kind != SymbolKind.Namespace); containingSymbol = containingSymbol.ContainingSymbol) 367Symbol? containingSymbol = symbol.ContainingSymbol;
Symbols\Synthesized\Records\SynthesizedPrimaryConstructorParameterBackingFieldSymbol.cs (3)
63=> ParameterSymbol.ContainingSymbol.ContainingSymbol; 66=> ParameterSymbol.ContainingSymbol.ContainingType;
Symbols\Synthesized\SynthesizedContainer.cs (3)
62if (ContainingSymbol.Kind == SymbolKind.NamedType && ContainingSymbol.IsImplicitlyDeclared) 67var compilation = ContainingSymbol.DeclaringCompilation;
Symbols\Tuples\TupleTypeSymbol.cs (1)
1083Debug.Assert((object)underlyingAssociatedField.ContainingSymbol == TupleUnderlyingType);
Symbols\TypeMap.cs (2)
122bool synthesized = !ReferenceEquals(oldTypeParameters[0].ContainingSymbol.OriginalDefinition, newOwner.OriginalDefinition); 183oldOwner = oldOwner.ContainingSymbol.OriginalDefinition as MethodSymbol;
Symbols\TypeParameterSymbol.cs (5)
127return this.ContainingSymbol as MethodSymbol; 138return this.ContainingSymbol as NamedTypeSymbol; 673return other.ContainingSymbol.ContainingType.Equals(this.ContainingSymbol.ContainingType, comparison); 678return Hash.Combine(ContainingSymbol, Ordinal);
Symbols\TypeSymbolExtensions.cs (9)
352return p.ContainingSymbol.Kind == SymbolKind.Method; 483if (IsNamespaceName(type.ContainingSymbol, s_expressionsNamespaceName)) 499if (IsNamespaceName(type.ContainingSymbol, s_expressionsNamespaceName) && 561symbol = symbol.ContainingSymbol; 1010for (Symbol s2 = sym2; s2.Kind != SymbolKind.Namespace; s2 = s2.ContainingSymbol) 1215(type, parameterContainer, unused) => type.TypeKind == TypeKind.TypeParameter && (object)type.ContainingSymbol == (object)parameterContainer; 1233(type, _, _) => type.TypeKind == TypeKind.TypeParameter && type.ContainingSymbol is MethodSymbol; 1763methodOrType = methodOrType.ContainingSymbol; 1777var container = type.ContainingSymbol;
Symbols\UpdatedContainingSymbolLocal.cs (1)
70ContainingSymbol.Equals(otherLocal.ContainingSymbol, compareKind));