24 overrides of ContainingType
Microsoft.CodeAnalysis.CSharp (24)
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.FieldSymbol.cs (1)
110public override NamedTypeSymbol ContainingType
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.PropertySymbol.cs (1)
171public override NamedTypeSymbol ContainingType
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.SynthesizedMethodBase.cs (1)
46public override NamedTypeSymbol ContainingType
Symbols\Metadata\PE\PEEventSymbol.cs (1)
225public override NamedTypeSymbol ContainingType
Symbols\Metadata\PE\PEFieldSymbol.cs (1)
170public override NamedTypeSymbol ContainingType
Symbols\Metadata\PE\PEMethodSymbol.cs (1)
446public override NamedTypeSymbol ContainingType => _containingType;
Symbols\Metadata\PE\PEPropertySymbol.cs (1)
406public override NamedTypeSymbol ContainingType
Symbols\NamedTypeSymbol.cs (1)
110public override NamedTypeSymbol ContainingType
Symbols\NamespaceSymbol.cs (1)
90public sealed override NamedTypeSymbol ContainingType
Symbols\Source\SourceEventSymbol.cs (1)
101public override NamedTypeSymbol ContainingType
Symbols\Source\SourceFieldSymbol.cs (1)
106public override NamedTypeSymbol ContainingType
Symbols\Source\SourceMemberMethodSymbol.cs (1)
500public override NamedTypeSymbol ContainingType
Symbols\Source\SourcePropertySymbolBase.cs (1)
511public override NamedTypeSymbol ContainingType
Symbols\SubstitutedFieldSymbol.cs (1)
46public override NamedTypeSymbol ContainingType
Symbols\SubstitutedMethodSymbol.cs (1)
198public override NamedTypeSymbol ContainingType
Symbols\SubstitutedPropertySymbol.cs (1)
47public override NamedTypeSymbol ContainingType
Symbols\Synthesized\Records\SynthesizedPrimaryConstructorParameterBackingFieldSymbol.cs (1)
65public override NamedTypeSymbol ContainingType
Symbols\Synthesized\SynthesizedBackingFieldSymbol.cs (1)
151public override NamedTypeSymbol ContainingType
Symbols\Synthesized\SynthesizedFieldSymbolBase.cs (1)
150public override NamedTypeSymbol ContainingType
Symbols\Synthesized\SynthesizedGlobalMethodSymbol.cs (1)
82public sealed override NamedTypeSymbol ContainingType
Symbols\Synthesized\SynthesizedImplementationMethod.cs (1)
120public sealed override NamedTypeSymbol ContainingType
Symbols\Synthesized\SynthesizedInstanceConstructor.cs (1)
60public sealed override NamedTypeSymbol ContainingType
Symbols\Synthesized\SynthesizedIntrinsicOperatorSymbol.cs (1)
320public override NamedTypeSymbol ContainingType
Symbols\Synthesized\SynthesizedStaticConstructor.cs (1)
30public override NamedTypeSymbol ContainingType
544 references to ContainingType
Microsoft.CodeAnalysis.CSharp (544)
Binder\Binder.cs (1)
432_ => member.ContainingType
Binder\Binder.ValueChecks.cs (18)
893getItemOrSliceHelper = getItemOrSliceHelper.AsMember(getItemOrSliceHelper.ContainingType.Construct(ImmutableArray.Create(elementAccess.Expression.Type.TryGetInlineArrayElementField().TypeWithAnnotations))); 1153if (RequiresAssignableVariable(valueKind) && !backingField.ContainingType.IsReferenceType && (this.ContainingMemberOrLambda as MethodSymbol)?.IsEffectivelyReadOnly == true) 1394if (fieldSymbol.IsStatic || fieldSymbol.ContainingType.IsReferenceType) 1420? TypeSymbol.Equals(fieldSymbol.ContainingType, containing.ContainingType, TypeCompareKind.AllIgnoreOptions) 1422: TypeSymbol.Equals(fieldSymbol.ContainingType.OriginalDefinition, containing.ContainingType.OriginalDefinition, TypeCompareKind.AllIgnoreOptions))) 1477if (fieldSymbol.IsStatic || fieldSymbol.ContainingType.IsReferenceType) 1499if (fieldSymbol.IsStatic || fieldSymbol.ContainingType.IsReferenceType) 1524if (eventSymbol.IsStatic || eventSymbol.ContainingType.IsReferenceType) 2508return method.ContainingType.IsRefLikeType; 3011if (!_underlyingParameter.ContainingType.IsInterface || _type.IsReferenceType) 3041if (!_underlyingParameter.ContainingType.IsInterface || _type.IsReferenceType) 3410if (eventSymbol.IsStatic || eventSymbol.ContainingType.IsReferenceType) 4123if (fieldSymbol.IsStatic || !fieldSymbol.ContainingType.IsRefLikeType) 4839if (fieldSymbol.IsStatic || !fieldSymbol.ContainingType.IsRefLikeType) 5477this._symbol.ContainingType, 5517_symbol.ContainingType,
Binder\Binder_Await.cs (1)
157if (containingMemberOrLambda.ContainingType.IsScriptClass)
Binder\Binder_Conversions.cs (1)
1069ReportDiagnosticsIfObsolete(diagnostics, collectionBuilderMethod.ContainingType, syntax, hasBaseReceiver: false);
Binder\Binder_Expressions.cs (13)
51var containingType = memberOpt?.ContainingType; 1476var implicitReceiver = field.IsStatic ? null : ThisReference(node, field.ContainingType, wasCompilerGenerated: true); 2260NamedTypeSymbol declaringType = member.ContainingType; 4776NamedTypeSymbol containingType = constructor.ContainingType; 4936NamedTypeSymbol baseType = constructor.ContainingType.BaseTypeNoUseSiteDiagnostics; 5061if (resultMember is null || resultMember.ContainingType.SpecialType != SpecialType.System_Object) 5108return constructor.ContainingType is SourceNamedTypeSymbol sourceType && 6085constructor.ContainingType.HasRequiredMembersError) // An error will be reported on the constructor if from source, or a use-site diagnostic will be reported on the use if from metadata. 6090return constructor.ContainingType.AllRequiredMembers; 6604this.IsSymbolAccessibleConditional(constructor, containingType, ref useSiteInfo, constructor.ContainingType); 8521NamedTypeSymbol type = fieldSymbol.ContainingType; 8694if (symbol.ContainingType?.IsInterface == true) 10219return new ErrorPropertySymbol(candidate.ContainingType, propertyType, candidate.Name, candidate.IsIndexer, candidate.IsIndexedProperty);
Binder\Binder_Initializers.cs (3)
147Debug.Assert((ContainingMemberOrLambda is TypeSymbol containing && TypeSymbol.Equals(containing, fieldSymbol.ContainingType, TypeCompareKind.ConsiderEverything2)) || //should be the binder for the type 148fieldSymbol.ContainingType.IsImplicitClass); //however, we also allow fields in namespaces to help support script scenarios 152binder = new WithPrimaryConstructorParametersBinder(fieldSymbol.ContainingType, binder);
Binder\Binder_Invocation.cs (6)
1050if (call.ReceiverOpt.Type.IsRestrictedType() && !call.Method.ContainingType.IsInterface && !TypeSymbol.Equals(call.Method.ContainingType, call.ReceiverOpt.Type, TypeCompareKind.ConsiderEverything2)) 1052SymbolDistinguisher distinguisher = new SymbolDistinguisher(compilation, call.ReceiverOpt.Type, call.Method.ContainingType); 1058SymbolDistinguisher distinguisher = new SymbolDistinguisher(compilation, this.ContainingType, call.Method.ContainingType); 1789TypeSymbol.Equals(containingMethod.ContainingType, method.ContainingType, TypeCompareKind.ConsiderEverything) &&
Binder\Binder_Lookup.cs (2)
1029((options & LookupOptions.NamespacesOrTypesOnly) == 0 || !(current.IsSingleViable && TypeSymbol.Equals(current.SingleSymbolOrDefault.ContainingType, type, TypeCompareKind.AllIgnoreOptions)))) // The nested type will shadow everything from bases 1341symbol = symbol.ContainingType;
Binder\Binder_Operators.cs (5)
1030Debug.Assert(!(signature.Method?.ContainingType?.IsInterface ?? false)); 1150NamedTypeSymbol t = (NamedTypeSymbol)signature.Method.ContainingType; 1161SourceUserDefinedOperatorSymbol.IsSelfConstrainedTypeParameter((definition = signature.Method.OriginalDefinition).ReturnType.StrippedType(), definition.ContainingType)); 1383if (operatorMethod.ContainingType.IsInterface && 2389if (methodOpt?.ContainingType?.IsInterface == true && methodOpt.IsStatic)
Binder\Binder_Statements.cs (9)
1279((object)fixedPatternMethod == null || fixedPatternMethod.ContainingType.SpecialType != SpecialType.System_String)) 1752new CSDiagnosticInfo(ErrorCode.ERR_BadEventUsage, leastOverridden, leastOverridden.ContainingType) : 1773TypeSymbol.Equals(sourceProperty.ContainingType, fromMember.ContainingType, TypeCompareKind.AllIgnoreOptions) && 1780if (!propertySymbol.IsDefinition && propertySymbol.ContainingType.Equals(propertySymbol.ContainingType.OriginalDefinition, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)) 3813NamedTypeSymbol containingType = constructor.ContainingType; 3914NamedTypeSymbol baseType = constructor.ContainingType.BaseTypeNoUseSiteDiagnostics; 3943if (!AccessCheck.IsSymbolAccessible(baseConstructor, constructor.ContainingType, ref useSiteInfo)) 3954BoundExpression receiver = new BoundThisReference(syntax, constructor.ContainingType) { WasCompilerGenerated = true };
Binder\Binder_Symbols.cs (1)
1733symbol.MergeUseSiteInfo(ref info, symbol.ContainingType.GetUseSiteInfo());
Binder\DecisionDagBuilder.cs (2)
330var iTupleType = getLengthProperty.ContainingType; 365while (input.Source is BoundDagTypeEvaluation source && isDerivedType(source.Input.Type, symbol.ContainingType))
Binder\LockBinder.cs (1)
88!TypeSymbol.Equals(scopeType.ContainingType, lockType, TypeCompareKind.ConsiderEverything))
Binder\RefSafetyAnalysis.cs (2)
43var type = symbol.ContainingType; 1080resultType: node.EnumeratorInfoOpt.GetEnumeratorInfo.Method.ContainingType,
Binder\Semantics\AccessCheck.cs (2)
106symbol = symbol.ContainingType; 212return IsMemberAccessible(symbol.ContainingType, symbol.DeclaredAccessibility, within, throughTypeOpt, out failedThroughTypeCheck, compilation, ref useSiteInfo);
Binder\Semantics\Conversions\Conversions.cs (2)
342else if (method.ContainingType.IsNullableType() && !method.IsOverride) 463if (method.ContainingType.IsNullableType() && !method.IsOverride)
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (1)
3215constructedFromMethod.ContainingType,
Binder\Semantics\OverloadResolution\OverloadResolution.cs (9)
895NamedTypeSymbol containingType = member.ContainingType; 1116NamedTypeSymbol memberContainingType = member.ContainingType; 1375checkOverrideContainingType && !moreDerivedOverride.ContainingType.IsDerivedFrom(member.ContainingType, TypeCompareKind.ConsiderEverything, ref useSiteInfo) || 1409if (!member.ContainingType.IsClassType()) 1428NamedTypeSymbol memberContainingType = member.ContainingType; 2486if (m1.Member.ContainingType.TypeKind == TypeKind.Submission && m2.Member.ContainingType.TypeKind == TypeKind.Submission) 4324method.ContainingType,
BoundTree\Constructors.cs (3)
62!fieldSymbol.ContainingType.IsValueType || 254: this(syntax, constructor, ImmutableArray.Create<BoundExpression>(arguments), default(ImmutableArray<string?>), default(ImmutableArray<RefKind>), false, default(ImmutableArray<int>), default(BitVector), null, null, constructor.ContainingType) 258: this(syntax, constructor, arguments, default(ImmutableArray<string?>), default(ImmutableArray<RefKind>), false, default(ImmutableArray<int>), default(BitVector), null, null, constructor.ContainingType)
CodeGen\CodeGenerator_HasHome.cs (1)
245if (!TypeSymbol.Equals(field.ContainingType, containingSymbol.ContainingSymbol as NamedTypeSymbol, TypeCompareKind.AllIgnoreOptions))
CodeGen\EmitConversion.cs (2)
354if (!method.IsStatic && method.IsMetadataVirtual() && !method.ContainingType.IsDelegateType() && !receiver.SuppressVirtualCalls) 361method = method.GetConstructedLeastOverriddenMethod(_method.ContainingType, requireSameReturnType: true);
CodeGen\EmitExpression.cs (13)
179var thisType = _method.ContainingType; 1139Debug.Assert(!field.IsConst || field.ContainingType.SpecialType == SpecialType.System_Decimal, 1645Debug.Assert(TypeSymbol.Equals(method.ContainingType, receiver.Type, TypeCompareKind.ConsiderEverything2)); 1650EmitSymbolToken(method.ContainingType, call.Syntax); 1852NamedTypeSymbol methodContainingType = method.ContainingType; 1953actualMethodTargetedByTheCall = method.GetConstructedLeastOverriddenMethod(_method.ContainingType, requireSameReturnType: true); 1956if (callKind == CallKind.ConstrainedCallVirt && actualMethodTargetedByTheCall.ContainingType.IsValueType) 1973if (IsThisReceiver(receiver) && actualMethodTargetedByTheCall.ContainingType.IsSealed && 2299Debug.Assert(method.ContainingType.IsVerifierValue(), "this is not a value type"); 2312var containingType = method.ContainingType; 2488if (originalDef.ContainingType.Name == NamedTypeSymbol.ValueTupleTypeName && 3688EmitSymbolToken(node.Method.ContainingType, node.Syntax); 3715EmitSymbolToken(node.Field.ContainingType, node.Syntax);
CodeGen\EmitStackAllocInitializer.cs (1)
74var readOnlySpan = spanGetItemDefinition.ContainingType.Construct(elementType);
Compilation\CSharpCompilation.cs (2)
2007if (candidate.IsGenericMethod || candidate.ContainingType.IsGenericType) 3081return IsDefinedOrImplementedInSourceTree(symbol.ContainingType, tree, span);
Compilation\InitializerSemanticModel.cs (2)
279Debug.Assert(MemberSymbol.ContainingType is SourceMemberContainerTypeSymbol); 280return MemberSymbol.ContainingType is SourceMemberContainerTypeSymbol type &&
Compilation\SyntaxTreeSemanticModel.cs (1)
1279outer = outer.GetFieldInitializerBinder(symbol, suppressBinderFlagsFieldInitializer: !this.IsRegularCSharp && symbol.ContainingType.IsScriptClass);
Compiler\ClsComplianceChecker.cs (10)
330CheckParameterCompliance(symbol.Parameters, symbol.ContainingType); 331CheckTypeParameterCompliance(symbol.TypeParameters, symbol.ContainingType); 375CheckParameterCompliance(symbol.Parameters, symbol.ContainingType); 501NamedTypeSymbol containingType = symbol.ContainingType; 545NamedTypeSymbol containingType = symbol.ContainingType; 738System.Diagnostics.Debug.Assert(method.ContainingType.TypeKind == TypeKind.Delegate); 739symbol = method.ContainingType; // Refer to the delegate type in diagnostics. 760if (!IsCompliantType(type, symbol.ContainingType)) 1174Symbol containing = (Symbol)symbol.ContainingType ?? symbol.ContainingAssembly; 1228symbol = symbol.ContainingType;
Compiler\DocumentationCommentCompiler.cs (3)
293var symbolForDocComments = symbol is SynthesizedRecordPropertySymbol ? symbol.ContainingType : symbol; 672symbol = symbol.ContainingType; 1100diagnostics.AddDependencies(symbol as TypeSymbol ?? symbol.ContainingType);
Compiler\MethodBodySynthesizer.cs (6)
37Debug.Assert((object)constructor.ContainingType.BaseTypeNoUseSiteDiagnostics == null || constructor.ContainingType.BaseTypeNoUseSiteDiagnostics.SpecialType == SpecialType.System_Object); 40BoundExpression receiver = new BoundThisReference(syntax, constructor.ContainingType) { WasCompilerGenerated = true }; 96var thisReference = new BoundThisReference(syntax, submissionConstructor.ContainingType) { WasCompilerGenerated = true }; 548method.ContainingType) 595NamedTypeSymbol baseType = method.ContainingType.BaseTypeNoUseSiteDiagnostics;
Compiler\MethodBodySynthesizer.Lowered.cs (3)
384NamedTypeSymbol equalityComparerType = system_Collections_Generic_EqualityComparer_T__GetHashCode.ContainingType; 418NamedTypeSymbol equalityComparerType = equalityComparer_Equals.ContainingType; 465BoundExpression invocation = F.Call(methodToInvoke.IsStatic ? null : (useBaseReference ? (BoundExpression)F.Base(baseType: methodToInvoke.ContainingType) : F.This()),
Compiler\MethodCompiler.cs (13)
243synthesizedEntryPoint = new SynthesizedEntryPointSymbol.AsyncForwardEntryPoint(compilation, entryPoint.ContainingType, entryPoint); 247moduleBeingBuilt.AddSynthesizedDefinition(entryPoint.ContainingType, synthesizedEntryPoint.GetCciAdapter()); 276new TypeCompilationState(synthesizedEntryPoint.ContainingType, compilation, moduleBeingBuilt), 831if (!interfaces.Contains(synthesizedExplicitImpl.ExplicitInterfaceImplementations[0].ContainingType, 895if (methodSymbol.IsAbstract || methodSymbol.ContainingType?.IsDelegateType() == true) 1021Debug.Assert(!prependedDefaultValueTypeConstructorInitializer || methodSymbol.ContainingType.IsStructType()); 1035((methodSymbol.ContainingType.IsStructType() && !methodSymbol.IsImplicitConstructor) || 1394method.ContainingType, 1421method.ContainingType, 1439method.ContainingType, 2335Debug.Assert(!method.ContainingType.IsDelegateType()); 2360if (ctorCall != null && !ctorCall.HasAnyErrors && ctorCall.Method != method && TypeSymbol.Equals(ctorCall.Method.ContainingType, method.ContainingType, TypeCompareKind.ConsiderEverything2))
Compiler\SynthesizedMetadataCompiler.cs (1)
80if (!interfaces.Contains(synthesizedExplicitImpl.ExplicitInterfaceImplementations[0].ContainingType,
DocumentationComments\DocumentationCommentIDVisitor.PartVisitor.cs (5)
68Visit(symbol.ContainingType, builder); 101Visit(symbol.ContainingType, builder); 127Visit(symbol.ContainingType, builder); 141Visit(symbol.ContainingType, builder); 164for (NamedTypeSymbol curr = containingSymbol.ContainingType; (object)curr != null; curr = curr.ContainingType)
Emitter\EditAndContinue\CSharpSymbolMatcher.cs (1)
534var otherType = (NamedTypeSymbol?)Visit(member.ContainingType);
Emitter\Model\EventSymbolAdapter.cs (2)
109return AdaptedEventSymbol.ContainingType.GetCciAdapter(); 129return AdaptedEventSymbol.ContainingType.GetCciAdapter();
Emitter\Model\FieldSymbolAdapter.cs (2)
97return moduleBeingBuilt.Translate(AdaptedFieldSymbol.ContainingType, 276return AdaptedFieldSymbol.ContainingType.GetCciAdapter();
Emitter\Model\MethodSymbolAdapter.cs (8)
58(!AdaptedMethodSymbol.IsGenericMethod || PEModuleBuilder.IsGenericType(AdaptedMethodSymbol.ContainingType))) 60Debug.Assert((object)AdaptedMethodSymbol.ContainingType != null && 61PEModuleBuilder.IsGenericType(AdaptedMethodSymbol.ContainingType)); 84NamedTypeSymbol containingType = AdaptedMethodSymbol.ContainingType; 266NamedTypeSymbol container = AdaptedMethodSymbol.ContainingType; 303return AdaptedMethodSymbol.ContainingType.GetCciAdapter(); 615return this.IsExtern || (object)ContainingType != null && ContainingType.TypeKind == TypeKind.Delegate;
Emitter\Model\NamedTypeSymbolAdapter.cs (2)
389Debug.Assert(body.ContainingType == (object)container); 392if (!interfaces.Contains(implemented.ContainingType, SymbolEqualityComparer.ConsiderEverything))
Emitter\Model\PEModuleBuilder.cs (4)
1184else if (!needDeclaration && IsGenericType(fieldSymbol.ContainingType)) 1250NamedTypeSymbol container = methodSymbol.ContainingType; 1324NamedTypeSymbol container = methodSymbol.ContainingType; 1432IsGenericType(container.ContainingType);
Emitter\Model\PropertySymbolAdapter.cs (2)
223return AdaptedPropertySymbol.ContainingType.GetCciAdapter(); 243return AdaptedPropertySymbol.ContainingType.GetCciAdapter();
Emitter\Model\SpecializedGenericMethodInstanceReference.cs (2)
27Debug.Assert(PEModuleBuilder.IsGenericType(underlyingMethod.ContainingType) && underlyingMethod.ContainingType.IsDefinition);
Emitter\Model\TypeMemberReference.cs (1)
20return moduleBeingBuilt.Translate(UnderlyingSymbol.ContainingType, (CSharpSyntaxNode)context.SyntaxNode, context.Diagnostics);
Emitter\NoPia\EmbeddedTypesManager.cs (3)
454var containerKind = field.AdaptedFieldSymbol.ContainingType.TypeKind; 461ReportNotEmbeddableSymbol(ErrorCode.ERR_InteropStructContainsMethods, field.AdaptedFieldSymbol.ContainingType, syntaxNodeOpt, diagnostics, this); 615NamedTypeSymbol namedType = member.AdaptedSymbol.ContainingType;
FlowAnalysis\AbstractFlowPass.cs (1)
2236fieldSymbol.ContainingType.TypeKind == TypeKind.Struct &&
FlowAnalysis\DefiniteAssignment.cs (5)
102&& CurrentSymbol is MethodSymbol { MethodKind: MethodKind.Constructor, ContainingType.TypeKind: TypeKind.Struct }; 1258Debug.Assert(CurrentSymbol is MethodSymbol { MethodKind: MethodKind.Constructor, ContainingType.TypeKind: TypeKind.Struct }); 1262NamedTypeSymbol containingType = thisParameter.ContainingType; 1311if (CurrentSymbol is not MethodSymbol { MethodKind: MethodKind.Constructor, ContainingType.TypeKind: TypeKind.Struct }) 1492if (fieldSymbol.ContainingType.IsReferenceType || fieldSymbol.IsStatic) return null;
FlowAnalysis\FlowAnalysisPass.cs (1)
114NamedTypeSymbol containingType = method.ContainingType;
FlowAnalysis\LocalDataFlowPass.cs (2)
165TypeSymbol containingType = symbol.ContainingType; 172while (!TypeSymbol.Equals(containingType, symbol.ContainingType, TypeCompareKind.ConsiderEverything))
FlowAnalysis\NullableWalker.cs (32)
650? method.ContainingType.GetMembersUnordered().SelectManyAsArray( 660foreach (var member in method.ContainingType.GetMembersUnordered()) 675if (chainedConstructorEnforcesRequiredMembers && !constructorEnforcesRequiredMembers && method.ContainingType.BaseTypeNoUseSiteDiagnostics is { } baseType) 895&& (!method.ContainingType.IsValueType 899return membersToBeInitialized(method.ContainingType, includeAllMembers: true, includeCurrentTypeRequiredMembers, includeBaseRequiredMembers); 904return membersToBeInitialized(method.ContainingType, includeAllMembers: method.IncludeFieldInitializersInBody(), includeCurrentTypeRequiredMembers, includeBaseRequiredMembers); 1000foreach (var member in property.ContainingType.GetMembers(notNullMemberName)) 1043foreach (var member in method.ContainingType.GetMembers(memberName)) 1079enforceMemberNotNullWhenIfAffected(returnStatement.Syntax, sense: true, members: method.ContainingType.GetMembers(memberName), state: pendingReturn.StateWhenTrue, otherState: pendingReturn.StateWhenFalse); 1084enforceMemberNotNullWhenIfAffected(returnStatement.Syntax, sense: false, members: method.ContainingType.GetMembers(memberName), state: pendingReturn.StateWhenFalse, otherState: pendingReturn.StateWhenTrue); 1110foreach (var member in method.ContainingType.GetMembers(memberName)) 1163var type = method.ContainingType; 1468&& method.ContainingType is SourceMemberContainerTypeSymbol containingType) 2212if ((constructor.IsStatic && containingSlot == 0 && constructor.ContainingType.Equals(symbol.ContainingType)) 2672TypeSymbol possibleBase = possibleMember.ContainingType; 3664(FieldSymbol { ContainingType: { IsTupleType: true }, TupleElementIndex: var oi } originalField, FieldSymbol { ContainingType: { IsTupleType: true }, TupleElementIndex: var ui } updatedField) => 4037var containingType = constructor?.ContainingType; 5154TypeSymbol methodContainer = method.ContainingType; 5539var containingType = this._symbol?.ContainingType; 6425var wellKnownType = wellKnownMethod.ContainingType; 6446if (implementationMethod.ContainingType.IsInterface) 6477while (!baseType.Equals(implementationMethod.ContainingType) && method is object) 6479if (baseType.Equals(method.ContainingType)) 6493if (method is object && baseType.Equals(method.ContainingType)) 6613method.ContainingType.IsReferenceType) 7204var type = method.ContainingType; 7917definition.ContainingType, 8253var symbolContainer = symbol.ContainingType; 8265Debug.Assert(symbol.ContainingType.IsDefinition); 10869if ((object)getMethod != null && getMethod.ContainingType.SpecialType == SpecialType.System_Nullable_T)
FlowAnalysis\ReadWriteWalker.cs (1)
173if (expr.FieldSymbol.ContainingType.IsReferenceType) return;
Lowering\AsyncRewriter\AsyncExceptionHandlerRewriter.cs (2)
40Debug.Assert(TypeSymbol.Equals(factory.CurrentType, (containingType ?? containingMethod.ContainingType), TypeCompareKind.ConsiderEverything2)); 449exceptionDispatchInfoCapture.ContainingType,
Lowering\AsyncRewriter\AsyncMethodToStateMachineRewriter.cs (1)
426? F.StaticCall(methodSymbol.ContainingType, methodSymbol, receiver)
Lowering\ClosureConversion\ClosureConversion.cs (10)
325get { return _topLevelMethod.ContainingType; } 430translatedLambdaContainer = _topLevelMethod.ContainingType; 452translatedLambdaContainer = _topLevelMethod.ContainingType; 457Debug.Assert((object)translatedLambdaContainer != _topLevelMethod.ContainingType || 677Debug.Assert(TypeSymbol.Equals(frameType, constructor.ContainingType, TypeCompareKind.ConsiderEverything2)); 849return (!_currentMethod.IsStatic && TypeSymbol.Equals(_currentMethod.ContainingType, _topLevelMethod.ContainingType, TypeCompareKind.ConsiderEverything2)) 851: FramePointer(node.Syntax, _topLevelMethod.ContainingType); // technically, not the correct static type 1019var translatedLambdaContainer = synthesizedMethod.ContainingType; 1061receiver = new BoundTypeExpression(syntax, null, synthesizedMethod.ContainingType);
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (1)
767unquoted = _bound.Call(_bound.MethodInfo(method, createDelegate.ContainingType), createDelegate, _bound.Typeof(delegateType, createDelegate.Parameters[0].Type), receiver);
Lowering\DiagnosticsPass_ExpressionTrees.cs (2)
278Binder.ReportDiagnosticsIfObsolete(_diagnostics, node.EventSymbol.AssociatedField, node.Syntax, hasBaseReceiver, _containingSymbol, _containingSymbol.ContainingType, BinderFlags.None); 292Binder.ReportDiagnosticsIfObsolete(_diagnostics, node.Event, ((AssignmentExpressionSyntax)node.Syntax).Left, hasBaseReceiver, _containingSymbol, _containingSymbol.ContainingType, BinderFlags.None);
Lowering\DiagnosticsPass_Warnings.cs (4)
116TypeSymbol baseType = fieldAccess.FieldSymbol.ContainingType; 154if ((object)interlocked != null && TypeSymbol.Equals(interlocked, method.ContainingType, TypeCompareKind.ConsiderEverything2)) 238(object)method.ContainingType == null || 239!method.ContainingType.IsComImport)
Lowering\InitializerRewriter.cs (1)
95new BoundThisReference(syntax, field.ContainingType);
Lowering\Instrumentation\CodeCoverageInstrumenter.cs (1)
145var containingType = method.ContainingType;
Lowering\Instrumentation\LocalStateTracingInstrumenter.cs (1)
176if (IsSameOrNestedType(method.ContainingType, contextType))
Lowering\Instrumentation\ModuleCancellationInstrumenter.cs (2)
166foreach (var member in methodDefinition.ContainingType.GetMembers(method.Name)) 215var result = overload.AsMember(method.ContainingType);
Lowering\IteratorRewriter\IteratorFinallyMethodSymbol.cs (1)
206get { return ContainingType.Locations; }
Lowering\LocalRewriter\DelegateCacheContainer.cs (1)
36_containingSymbol = ownerMethod.ContainingType;
Lowering\LocalRewriter\DelegateCacheRewriter.cs (1)
212FindTypeParameters(method.ContainingType, result);
Lowering\LocalRewriter\LocalRewriter.cs (2)
72Debug.Assert(TypeSymbol.Equals(factory.CurrentType, (containingType ?? containingMethod.ContainingType), TypeCompareKind.ConsiderEverything2)); 925if (!lhsField.IsStatic && lhsField.ContainingType.IsStructType())
Lowering\LocalRewriter\LocalRewriter.DecisionDagRewriter.cs (1)
175!method.ContainingType.SpecialType.IsPrimitiveRecursiveStruct();
Lowering\LocalRewriter\LocalRewriter.PatternLocalRewriter.cs (1)
175receiver = _factory.Type(method.ContainingType);
Lowering\LocalRewriter\LocalRewriter_Call.cs (7)
48NamedTypeSymbol firstContainer = node.ApplicableMethods.First().ContainingType; 49Debug.Assert(node.ApplicableMethods.All(m => !m.RequiresInstanceReceiver && TypeSymbol.Equals(m.ContainingType, firstContainer, TypeCompareKind.ConsiderEverything2))); 152Debug.Assert(!interceptor.ContainingType.IsGenericType); 157method.ContainingType.GetAllTypeArgumentsNoUseSiteDiagnostics(typeArgumentsBuilder); 191var isAccessible = AccessCheck.IsSymbolAccessible(interceptor, containingMethod.ContainingType, ref useSiteInfo); 450method.ContainingType.IsObjectType() && 1234methodOrIndexer.ContainingType;
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (1)
861var spanOfElementType = spanCtorArray.ContainingType.Construct(arrayType.ElementType);
Lowering\LocalRewriter\LocalRewriter_CompoundAssignmentOperator.cs (3)
371if (indexer.ContainingType.IsComImport) 486var memberContainingType = fieldOrEvent.ContainingType; 920if (method.ContainingType?.IsNullableType() == true)
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (2)
570var receiver = (!method.RequiresInstanceReceiver && !oldNodeOpt.IsExtensionMethod && !method.IsAbstract && !method.IsVirtual) ? _factory.Type(method.ContainingType) : mg.ReceiverOpt; 1866Debug.Assert(!meth.ContainingType.IsInterface);
Lowering\LocalRewriter\LocalRewriter_DelegateCreationExpression.cs (1)
35var receiver = (!method.RequiresInstanceReceiver && !node.IsExtensionMethod && !method.IsAbstract && !method.IsVirtual) ? _factory.Type(method.ContainingType) : VisitExpression(mg.ReceiverOpt)!;
Lowering\LocalRewriter\LocalRewriter_Event.cs (4)
24if (rewrittenReceiverOpt != null && node.Event.ContainingAssembly.IsLinked && node.Event.ContainingType.IsInterfaceType()) 26var @interface = node.Event.ContainingType; 278_diagnostics.Add(new CSDiagnosticInfo(ErrorCode.ERR_MissingPredefinedMember, invocationListProperty.ContainingType, accessorName), syntax.Location); 310BoundExpression eventInfo = _factory.New(ctor, _factory.Typeof(node.Event.ContainingType, ctor.Parameters[0].Type), _factory.Literal(node.Event.MetadataName));
Lowering\LocalRewriter\LocalRewriter_Field.cs (4)
26if (fieldSymbol.ContainingType.IsTupleType) 55var tupleType = tupleField.ContainingType; 72if (!TypeSymbol.Equals(underlyingField.ContainingType, currentLinkType, TypeCompareKind.ConsiderEverything2)) 91while (!TypeSymbol.Equals(underlyingField.ContainingType, currentLinkType, TypeCompareKind.ConsiderEverything2));
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (2)
336idisposableTypeSymbol = disposeMethod.ContainingType; 498if (!receiver.Type.IsReferenceType && method.ContainingType.IsInterface)
Lowering\LocalRewriter\LocalRewriter_IndexerAccess.cs (2)
243MethodSymbol createSpan = getCreateSpanHelper(node, spanType: getItemOrSliceHelper.ContainingType, intType: (NamedTypeSymbol)getItemOrSliceHelper.Parameters[0].Type); 391NamedTypeSymbol spanType = getItemOrSliceHelper.ContainingType;
Lowering\LocalRewriter\LocalRewriter_Literal.cs (6)
73curMethod.ContainingType.SpecialType != SpecialType.System_Decimal) && 91if (useField is { HasUseSiteError: false, ContainingType: { HasUseSiteError: false } }) 133Debug.Assert(ctor.ContainingType.SpecialType == SpecialType.System_Decimal); 139constantValueOpt: constantValue, initializerExpressionOpt: null, type: ctor.ContainingType); 152Debug.Assert(ctor.ContainingType.SpecialType == SpecialType.System_DateTime); 159constantValueOpt: ConstantValue.NotAvailable, initializerExpressionOpt: null, type: ctor.ContainingType);
Lowering\LocalRewriter\LocalRewriter_NullCoalescingOperator.cs (1)
201if (method.IsStatic && method.ContainingType.SpecialType == SpecialType.System_String)
Lowering\LocalRewriter\LocalRewriter_ObjectCreationExpression.cs (2)
77rewrittenObjectCreation = node.Update(constructor, rewrittenArguments, argumentRefKindsOpt, MakeObjectCreationInitializerForExpressionTree(node.InitializerExpressionOpt), changeTypeOpt: constructor.ContainingType); 94rewrittenObjectCreation = node.Update(constructor, rewrittenArguments, argumentRefKindsOpt, newInitializerExpression: null, changeTypeOpt: constructor.ContainingType);
Lowering\LocalRewriter\LocalRewriter_ObjectOrCollectionInitializerExpression.cs (2)
667Debug.Assert(_compilation.Conversions.ClassifyConversionFromType(rewrittenReceiver.Type, memberSymbol.ContainingType, isChecked: false, ref discardedUseSiteInfo).IsImplicit || 668_compilation.Conversions.HasImplicitConversionToOrImplementsVarianceCompatibleInterface(rewrittenReceiver.Type, memberSymbol.ContainingType, ref discardedUseSiteInfo, out _));
Lowering\LocalRewriter\LocalRewriter_StringConcat.cs (4)
173if (method.IsStatic && method.ContainingType.SpecialType == SpecialType.System_String) 248objectCreationConstructor.ContainingType.IsReadOnlySpanChar(): 508var readOnlySpanOfChar = readOnlySpanCtorRefParamGeneric.ContainingType.Construct(charType); 557type: readOnlySpanCtorRefParamChar.ContainingType);
Lowering\LocalRewriter\LoweredDynamicOperationFactory.cs (1)
595return _factory.ArrayOrEmpty(argumentInfoFactory.ContainingType, infos);
Lowering\MethodToClassRewriter.cs (12)
548.AsMember((NamedTypeSymbol)this.VisitType(node.Field.ContainingType)); 557.AsMember((NamedTypeSymbol)this.VisitType(node.FieldSymbol.ContainingType)); 623if (method.ContainingType.IsAnonymousType) 626var newType = (NamedTypeSymbol)TypeMap.SubstituteType(method.ContainingType).AsTypeSymbolOnly(); 627if (ReferenceEquals(newType, method.ContainingType)) 648.AsMember((NamedTypeSymbol)TypeMap.SubstituteType(method.ContainingType).AsTypeSymbolOnly()) 661if (!property.ContainingType.IsAnonymousType) 665.AsMember((NamedTypeSymbol)TypeMap.SubstituteType(property.ContainingType).AsTypeSymbolOnly()); 669var newType = (NamedTypeSymbol)TypeMap.SubstituteType(property.ContainingType).AsTypeSymbolOnly(); 670if (ReferenceEquals(newType, property.ContainingType)) 692.AsMember((NamedTypeSymbol)TypeMap.SubstituteType(field.ContainingType).AsTypeSymbolOnly()); 745TypeMap? typeMap = methodBeingWrapped.ContainingType is SubstitutedNamedTypeSymbol substitutedType ? substitutedType.TypeSubstitution : TypeMap.Empty;
Lowering\SpillSequenceSpiller.cs (2)
419var receiver = Spill(builder, field.ReceiverOpt, fieldSymbol.ContainingType.IsValueType ? refKind : RefKind.None); 924if (field.FieldSymbol.ContainingType.IsReferenceType)
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 (2)
193get { return OriginalMethod.ContainingType; } 614var isFieldOfStruct = !field.FieldSymbol.ContainingType.IsReferenceType;
Lowering\StateMachineRewriter\StateMachineRewriter.cs (2)
63Debug.Assert(TypeSymbol.Equals(F.CurrentType, method.ContainingType, TypeCompareKind.ConsiderEverything2)); 239var containingType = method.ContainingType;
Lowering\StateMachineRewriter\StateMachineTypeSymbol.cs (2)
36get { return KickoffMethod.ContainingType; } 62var kickoffType = KickoffMethod.ContainingType;
Lowering\StateMachineRewriter\SynthesizedStateMachineProperty.cs (2)
25_name = ExplicitInterfaceHelpers.GetMemberName(interfacePropertyGetter.AssociatedSymbol.Name, interfacePropertyGetter.ContainingType, aliasQualifierOpt: null); 26var getterName = ExplicitInterfaceHelpers.GetMemberName(interfacePropertyGetter.Name, interfacePropertyGetter.ContainingType, aliasQualifierOpt: null);
Lowering\SyntheticBoundNodeFactory.cs (9)
76_currentType = value.ContainingType; 104: this(topLevelMethod, topLevelMethod.ContainingType, node, compilationState, diagnostics, instrumentationState) 134Debug.Assert(TopLevelMethod is null || TypeSymbol.Equals(TopLevelMethod.ContainingType, CurrentType, TypeCompareKind.ConsiderEverything2)); 143TypeSymbol.Equals(CurrentFunction.ContainingType, CurrentType, TypeCompareKind.ConsiderEverything2)); 761constructor.ContainingType) 1302GetMethodFromHandleMethod(ctor.ContainingType, constructorInfo), 1401if (!method.ContainingType.IsValueType || !Microsoft.CodeAnalysis.CSharp.CodeGen.CodeGenerator.MayUseCallForStructMethod(method)) 1409GetMethodFromHandleMethod(method.ContainingType, systemReflectionMethodInfo), 1425GetFieldFromHandleMethod(field.ContainingType),
Operations\CSharpOperationFactory.cs (1)
2583boundITuplePattern.GetLengthMethod.ContainingType.GetPublicSymbol(),
Symbols\AnonymousTypes\AnonymousTypeManager.SymbolCollection.cs (1)
101ReportErrorOnSymbol(symbol.ContainingType, diagnostics, ref hasError);
Symbols\AnonymousTypes\AnonymousTypeManager.Templates.cs (1)
780NamedTypeSymbol translatedType = TranslateAnonymousTypeSymbol(method.ContainingType);
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.FieldSymbol.cs (2)
107get { return _property.ContainingType; } 114return _property.ContainingType;
Symbols\ConstructedMethodSymbol.cs (1)
20map: new TypeMap(constructedFrom.ContainingType, ((MethodSymbol)constructedFrom.OriginalDefinition).TypeParameters, typeArgumentsWithAnnotations),
Symbols\ErrorTypeSymbol.ErrorTypeParameterSymbol.cs (2)
197other.ContainingType.Equals(this.ContainingType, comparison);
Symbols\EventSymbol.cs (3)
346return TypeSymbol.Equals(this.ContainingType, other.ContainingType, compareKind) && ReferenceEquals(this.OriginalDefinition, other.OriginalDefinition); 352hash = Hash.Combine(this.ContainingType, hash);
Symbols\FieldSymbol.cs (4)
438return ContainingType.IsTupleType ? this : null; 474if (!ContainingType.IsTupleType) 479if (!ContainingType.IsDefinition) 485int arity = ContainingType.Arity;
Symbols\MemberSymbolExtensions.cs (3)
129Debug.Assert(symbol.ContainingType.IsInterface); 399&& !(methodSymbol.HasThisConstructorInitializer(out var initializerSyntax) && !methodSymbol.ContainingType.IsDefaultValueTypeConstructor(initializerSyntax)) 455method.ContainingType?.IsValueType == true &&
Symbols\Metadata\PE\PEMethodSymbol.cs (2)
804Debug.Assert(TypeSymbol.Equals(propertyOrEventSymbol.ContainingType, _containingType, TypeCompareKind.ConsiderEverything2)); 1348if (method.ContainingType.IsClassType())
Symbols\Metadata\PE\PEParameterSymbol.cs (2)
309typeSymbol = NativeIntegerTypeDecoder.TransformType(typeSymbol, handle, moduleSymbol, containingSymbol.ContainingType); 1198PEPropertySymbol => new MetadataDecoder(containingModule, (PENamedTypeSymbol)ContainingType),
Symbols\MethodSymbol.cs (6)
367internal virtual bool IsEffectivelyReadOnly => (IsDeclaredReadOnly || ContainingType?.IsReadOnly == true) && IsValidReadOnlyTarget; 369protected bool IsValidReadOnlyTarget => !IsStatic && ContainingType.IsStructType() && MethodKind != MethodKind.Constructor && !IsInitOnly; 655return MethodKind == MethodKind.Constructor && ContainingType.IsScriptClass; 819return this.ContainingType; 1047if (isGenericMethod(this) || ContainingType.IsGenericType) 1271if (methodToAttribute.ShouldCheckRequiredMembers() && methodToAttribute.ContainingType.HasAnyRequiredMembers)
Symbols\MethodSymbolExtensions.cs (2)
61else if (method.ContainingType.SpecialType == SpecialType.System_Object) 219method.ContainingType is NamedTypeSymbol containingType &&
Symbols\OverriddenOrHiddenMembersHelpers.cs (14)
114NamedTypeSymbol containingType = member.ContainingType; 183FindOverriddenOrHiddenMembers(member, member.ContainingType, memberIsFromSomeCompilation, out hiddenBuilder, 284if ((object)overriddenAccessor != null && IsOverriddenSymbolAccessible(overriddenAccessor, accessor.ContainingType) && 374if ((object)overriddenAccessor != null && IsOverriddenSymbolAccessible(overriddenAccessor, accessor.ContainingType) && 413NamedTypeSymbol containingType = member.ContainingType; 717(!representativeMember.ContainingType.IsDefinition || representativeMember.IsIndexer()); 792Debug.Assert(representativeMember.Kind == SymbolKind.Property || !representativeMember.ContainingType.IsDefinition); 796foreach (Symbol otherMember in representativeMember.ContainingType.GetMembers(representativeMember.Name)) 856Debug.Assert(representativeMember.Kind == SymbolKind.Property || !representativeMember.ContainingType.IsDefinition); 859foreach (Symbol otherMember in representativeMember.ContainingType.GetMembers(representativeMember.Name)) 975csharpOverriddenMethod.ContainingType.Equals(runtimeOverriddenMethod.ContainingType, TypeCompareKind.CLRSignatureCompareOptions); 991foreach (Symbol otherMethod in method.ContainingType.GetMembers(method.Name)) 1027NamedTypeSymbol containingType = method.ContainingType;
Symbols\OverriddenOrHiddenMembersResult.cs (2)
60NamedTypeSymbol overriddenByDefinitionContaining = overriddenByDefinitionMember.ContainingType; 62for (NamedTypeSymbol baseType = substitutedOverridingMember.ContainingType.BaseTypeNoUseSiteDiagnostics;
Symbols\ParameterSymbol.cs (1)
164(refKind == RefKind.Ref && ContainingSymbol.ContainingType.IsComImport));
Symbols\PropertySymbol.cs (5)
169var property = (PropertySymbol)this.GetLeastOverriddenMember(this.ContainingType); 181var property = (PropertySymbol)this.GetLeastOverriddenMember(this.ContainingType); 474return TypeSymbol.Equals(this.ContainingType, other.ContainingType, compareKind) && ReferenceEquals(this.OriginalDefinition, other.OriginalDefinition); 480hash = Hash.Combine(this.ContainingType, hash);
Symbols\PublicModel\Symbol.cs (1)
75return UnderlyingSymbol.ContainingType.GetPublicSymbol();
Symbols\Retargeting\RetargetingMethodSymbol.cs (1)
136new TypeWithAnnotations.Boxed(this.RetargetingTranslator.Retarget(_underlyingMethod.ReturnTypeWithAnnotations, RetargetOptions.RetargetPrimitiveTypesByTypeCode, this.ContainingType)),
Symbols\Retargeting\RetargetingPropertySymbol.cs (1)
70if (type.Type.TryAsDynamicIfNoPia(this.ContainingType, out TypeSymbol asDynamic))
Symbols\Retargeting\RetargetingSymbolTranslator.cs (5)
891var containingType = method.ContainingType; 939var containingType = property.ContainingType; 955var containingType = @event.ContainingType; 1055NamedTypeSymbol containingType = _toFind.ContainingType; 1167newAttributeType = newAttributeCtor.ContainingType;
Symbols\Source\ExplicitInterfaceHelpers.cs (5)
126var unsubstitutedInterfaceType = unsubstitutedPropertyImplemented.ContainingType; 189var containingType = implementingMember.ContainingType; 308if (!AccessCheck.IsSymbolAccessible(implementedMember, implementingMember.ContainingType, ref useSiteInfo, throughTypeOpt: null)) 332!AccessCheck.IsSymbolAccessible(accessor, implementingMember.ContainingType, ref useSiteInfo, throughTypeOpt: null)) 385NamedTypeSymbol explicitInterfaceType = implementedMember.ContainingType;
Symbols\Source\FieldSymbolWithAttributesAndModifiers.cs (4)
145var containingSourceType = (SourceMemberContainerTypeSymbol)ContainingType; 326if (this.ContainingType.Layout.Kind != LayoutKind.Explicit) 337if (this.ContainingType.Layout.Kind == LayoutKind.Explicit) 419AddSynthesizedAttribute(ref attributes, moduleBuilder.SynthesizeNullableAttributeIfNecessary(this, ContainingType.GetNullableContextValue(), type));
Symbols\Source\ModifierUtils.cs (4)
479if (symbol.ContainingType?.IsInterface == true && !symbol.ContainingAssembly.RuntimeSupportsDefaultInterfaceImplementation) 495case FieldSymbol when !symbol.IsAsRestrictive(symbol.ContainingType, ref useSiteInfo): 496case PropertySymbol { SetMethod: { } method } when !method.IsAsRestrictive(symbol.ContainingType, ref useSiteInfo): 498diagnostics.Add(ErrorCode.ERR_RequiredMemberCannotBeLessVisibleThanContainingType, errorLocation, symbol, symbol.ContainingType);
Symbols\Source\ParameterHelpers.cs (2)
678Debug.Assert(containingSymbol is null || (containingSymbol is FunctionPointerMethodSymbol or { ContainingType: not null })); 681ErrorFacts.GetStaticClassParameterCode(containingSymbol?.ContainingType?.IsInterfaceType() ?? false),
Symbols\Source\SourceAssemblySymbol.cs (5)
2231if ((object)forwardedType.ContainingType != null) 2233diagnostics.Add(ErrorCode.ERR_ForwardedTypeIsNested, GetAssemblyAttributeLocationForDiagnostic(arguments.AttributeSyntaxOpt), forwardedType, forwardedType.ContainingType); 2611var container = field.ContainingType as SourceMemberContainerTypeSymbol; 2705var containingType = field.ContainingType as SourceNamedTypeSymbol; 2766var containingType = field.ContainingType as SourceNamedTypeSymbol;
Symbols\Source\SourceComplexParameterSymbol.cs (1)
1670method.ContainingType.IsAtLeastAsVisibleAs(ContainingSymbol, ref useSiteInfo);
Symbols\Source\SourceEventAccessorSymbol.cs (1)
63name = ExplicitInterfaceHelpers.GetMemberName(accessorName, explicitlyImplementedEventOpt.ContainingType, aliasQualifierOpt);
Symbols\Source\SourceMemberContainerSymbol.cs (2)
895for (Symbol? container = this.ContainingType; !(container is null); container = container.ContainingType) 2681if (method.IsOverride && method.GetConstructedLeastOverriddenMethod(this, requireSameReturnType: false).ContainingType.SpecialType == Microsoft.CodeAnalysis.SpecialType.System_Object)
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (15)
256(!implementingMember.ContainingType.Equals(this, TypeCompareKind.ConsiderEverything) && 269wasImplementingMemberFound && implementingMember.ContainingType.IsInterface) 271HasBaseInterfaceDeclaringInterface(implementingMember.ContainingType, @interface, ref matchResult); 320if (synthesizedImplementation.ForwardingMethod is not null || TypeSymbol.Equals(implementingMember.ContainingType, this, TypeCompareKind.ConsiderEverything2)) 680if (symbol.ContainingType.IsInterface) 834NamedTypeSymbol overridingType = overridingMember.ContainingType; 873var overridingType = overridingMember.ContainingType; 924var leastOverriddenMember = overriddenMember.GetLeastOverriddenMember(overriddenMember.ContainingType); 1047var overridingType = overridingProperty.ContainingType; 1579if (!hidingMember.ContainingType.IsInterface) 1653if (!hiddenMember.IsAbstract || !hidingMember.ContainingType.IsAbstract) 1831IsOverrideOfPossibleImplementationUnderRuntimeRules(implementingMethod, @interfaceMethod.ContainingType)) 1855if (implementingMethod.ContainingType != (object)this) 1857if (implementingMethod.ContainingType.IsInterface || 1896NamedTypeSymbol type = implementingMethod.ContainingType;
Symbols\Source\SourceMethodSymbol.cs (1)
48else if (ContainingType is SourceMemberContainerTypeSymbol type)
Symbols\Source\SourceMethodSymbolWithAttributes.cs (14)
599CSharpAttributeData.DecodeMemberNotNullAttribute<MethodWellKnownAttributeData>(ContainingType, ref arguments); 604CSharpAttributeData.DecodeMemberNotNullWhenAttribute<MethodWellKnownAttributeData>(ContainingType, ref arguments); 626if (ContainingType.IsInterface || IsExplicitInterfaceImplementation) 724else if (this.ContainingType.IsInterfaceType()) 843if (isAnyNestedMethodGeneric || ContainingType?.IsGenericType == true) 953Debug.Assert(ContainingType is object); 971if (IsGenericMethod || ContainingType.IsGenericType) 1039if (ContainingType.IsGenericType) 1197if (ContainingType.IsGenericType) 1493diagnostics.Add(ErrorCode.ERR_ComImportWithImpl, this.GetFirstLocation(), this, ContainingType); 1505&& !this.ContainingType.IsComImport) 1561for (NamedTypeSymbol curr = this.ContainingType; (object)curr != null; curr = curr.ContainingType) 1653return this.ContainingType.IsInterface && 1743if (this.ContainingType.IsComImport && this.MethodKind == MethodKind.Constructor)
Symbols\Source\SourceNamedTypeSymbol.cs (1)
223diagnostics.Add(ErrorCode.WRN_TypeParameterSameAsOuterTypeParameter, location, name, tpEnclosing.ContainingType);
Symbols\Source\SourceOrdinaryMethodSymbol.cs (1)
1144diagnostics.Add(ErrorCode.WRN_TypeParameterSameAsOuterTypeParameter, location, name, tpEnclosing.ContainingType);
Symbols\Source\SourcePropertyAccessorSymbol.cs (1)
696name = ExplicitInterfaceHelpers.GetMemberName(accessorName, explicitlyImplementedPropertyOpt.ContainingType, aliasQualifierOpt);
Symbols\Source\SynthesizedAttributeData.cs (1)
47public override NamedTypeSymbol AttributeClass => _wellKnownMember.ContainingType;
Symbols\Source\ThisParameterSymbol.cs (2)
129internal ThisParameterSymbol(MethodSymbol forMethod) : this(forMethod, forMethod.ContainingType) 147if (ContainingType?.TypeKind != TypeKind.Struct)
Symbols\SubstitutedFieldSymbol.cs (2)
119return (object)other != null && TypeSymbol.Equals(_containingType, other.ContainingType, compareKind) && OriginalDefinition == other.OriginalDefinition; 131if (containingHashCode != this.OriginalDefinition.ContainingType.GetHashCode())
Symbols\SubstitutedMethodSymbol.cs (4)
44Debug.Assert(TypeSymbol.Equals(originalDefinition.ContainingType, containingSymbol.OriginalDefinition, TypeCompareKind.ConsiderEverything2)); 202return _containingSymbol is NamedTypeSymbol nt ? nt : _containingSymbol.ContainingType; 371if (containingHashCode == this.OriginalDefinition.ContainingType.GetHashCode() && 439if (!TypeSymbol.Equals(this.ContainingType, other.ContainingType, compareKind)) return false;
Symbols\Symbol.cs (5)
137return container.ContainingType; 258if (ContainingType?.TypeKind == TypeKind.Submission) 280if (ContainingType.TypeKind == TypeKind.Submission) 291Debug.Assert(ContainingType.TypeKind != TypeKind.Submission); 327return this.ContainingType;
Symbols\SymbolExtensions.cs (4)
41return symbol is NamedTypeSymbol && (object?)symbol.ContainingType != null; 180type = symbol.ContainingType; 316var upperLevelType = symbol.Kind == SymbolKind.NamedType ? (NamedTypeSymbol)symbol : symbol.ContainingType; 540return !symbol.IsSealed && (symbol.IsAbstract || symbol.IsVirtual) && (symbol.ContainingType?.IsInterface ?? false);
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListEnumeratorTypeSymbol.cs (4)
54var containingType = (SynthesizedReadOnlyListEnumeratorTypeSymbol)method.ContainingType; 66var containingType = (SynthesizedReadOnlyListEnumeratorTypeSymbol)method.ContainingType; 78var containingType = (SynthesizedReadOnlyListEnumeratorTypeSymbol)method.ContainingType; 97var containingType = (SynthesizedReadOnlyListEnumeratorTypeSymbol)method.ContainingType;
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListProperty.cs (1)
25Name = ExplicitInterfaceHelpers.GetMemberName(interfaceProperty.Name, interfaceProperty.ContainingType, aliasQualifierOpt: null);
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListTypeSymbol.cs (16)
473var containingType = (SynthesizedReadOnlyListTypeSymbol)method.ContainingType; 489interfaceMethod.ContainingType, 498var containingType = (SynthesizedReadOnlyListTypeSymbol)method.ContainingType; 557var containingType = (SynthesizedReadOnlyListTypeSymbol)method.ContainingType; 567else if (containingType.IsArray || !interfaceMethod.ContainingType.IsGenericType) 573interfaceMethod.ContainingType, 593var containingType = (SynthesizedReadOnlyListTypeSymbol)method.ContainingType; 601if (!interfaceMethod.ContainingType.IsGenericType) 621else if (containingType.IsArray || !interfaceMethod.ContainingType.IsGenericType) 627interfaceMethod.ContainingType, 650var containingType = (SynthesizedReadOnlyListTypeSymbol)method.ContainingType; 684var containingType = (SynthesizedReadOnlyListTypeSymbol)method.ContainingType; 698else if (containingType.IsArray || !interfaceMethod.ContainingType.IsGenericType) 704interfaceMethod.ContainingType, 747var equalityComparerType = equalityComparer_Equals.ContainingType; 773Debug.Assert(_field.Type.OriginalDefinition.Equals(symbol.ContainingType, TypeCompareKind.AllIgnoreOptions));
Symbols\Synthesized\Records\SynthesizedPrimaryConstructorParameterBackingFieldSymbol.cs (1)
66=> ParameterSymbol.ContainingSymbol.ContainingType;
Symbols\Synthesized\Records\SynthesizedRecordBaseEquals.cs (1)
45!overridden.ContainingType.Equals(ContainingType.BaseTypeNoUseSiteDiagnostics, TypeCompareKind.AllIgnoreOptions))
Symbols\Synthesized\Records\SynthesizedRecordCopyCtor.cs (2)
135if (member is MethodSymbol { ContainingType.IsRecord: true, MethodKind: MethodKind.Constructor } method) 145NamedTypeSymbol containingType = member.ContainingType;
Symbols\Synthesized\Records\SynthesizedRecordEqualityContractProperty.cs (4)
103if (overriding.ContainingType.BaseTypeNoUseSiteDiagnostics.IsObjectType()) 119!overridden.ContainingType.Equals(overriding.ContainingType.BaseTypeNoUseSiteDiagnostics, TypeCompareKind.AllIgnoreOptions)) 127diagnostics.Add(ErrorCode.ERR_DoesNotOverrideBaseEqualityContract, overriding.GetFirstLocation(), overriding, overriding.ContainingType.BaseTypeNoUseSiteDiagnostics);
Symbols\Synthesized\Records\SynthesizedRecordEquals.cs (2)
107if (baseEquals is null || !baseEquals.ContainingType.Equals(ContainingType.BaseTypeNoUseSiteDiagnostics, TypeCompareKind.AllIgnoreOptions) || 124F.Base(baseEquals.ContainingType),
Symbols\Synthesized\Records\SynthesizedRecordGetHashCode.cs (1)
88currentHashValue = F.Call(F.Base(overridden.ContainingType), overridden);
Symbols\Synthesized\Records\SynthesizedRecordObjectMethod.cs (1)
43if (overridden is object && !(overridden.ContainingType is SourceMemberContainerTypeSymbol { IsRecord: true } && overridden.ContainingModule == overriding.ContainingModule))
Symbols\Synthesized\Records\SynthesizedRecordPrintMembers.cs (3)
110!overridden.ContainingType.Equals(ContainingType.BaseTypeNoUseSiteDiagnostics, TypeCompareKind.AllIgnoreOptions)) 265NamedTypeSymbol baseType = overriding.ContainingType.BaseTypeNoUseSiteDiagnostics; 282!overridden.ContainingType.Equals(baseType, TypeCompareKind.AllIgnoreOptions))
Symbols\Synthesized\Records\SynthesizedRecordPropertySymbol.cs (1)
102parameter.ContainingType.GetMembersUnordered().Any((s, parameter) => (s as SynthesizedRecordPropertySymbol)?.BackingParameter == (object)parameter, parameter);
Symbols\Synthesized\SynthesizedBackingFieldSymbol.cs (1)
47if (!this.ContainingType.IsImplicitlyDeclared)
Symbols\Synthesized\SynthesizedEntryPointSymbol.cs (2)
29var containingType = initializerMethod.ContainingType; 257get { return ContainingType.AreLocalsZeroed; }
Symbols\Synthesized\SynthesizedImplementationMethod.cs (2)
38_name = name ?? ExplicitInterfaceHelpers.GetMemberName(interfaceMethod.Name, interfaceMethod.ContainingType, aliasQualifierOpt: null); 45var typeMap = interfaceMethod.ContainingType.TypeSubstitution ?? TypeMap.Empty;
Symbols\Synthesized\SynthesizedInstanceMethodSymbol.cs (1)
41return ContainingType.AreLocalsZeroed;
Symbols\Synthesized\SynthesizedSealedPropertyAccessor.cs (2)
52return _property.ContainingType; 95Debug.Assert(AccessCheck.IsSymbolAccessible(_overriddenAccessor, this.ContainingType, ref discardedUseSiteInfo));
Symbols\Tuples\TupleFieldSymbol.cs (4)
47Debug.Assert(container.Equals(underlyingField.ContainingType, TypeCompareKind.IgnoreDynamicAndTupleNames) || this is TupleVirtualElementFieldSymbol, 108NamedTypeSymbol originalContainer = ContainingType.OriginalDefinition; 268Debug.Assert(underlyingField.ContainingType.IsTupleType); 270Debug.Assert(name != underlyingField.Name || !container.Equals(underlyingField.ContainingType, TypeCompareKind.IgnoreDynamicAndTupleNames),
Symbols\Tuples\TupleTypeSymbol.cs (1)
1113if (TypeSymbol.Equals(underlyingMemberDefinition.ContainingType, TupleUnderlyingType.OriginalDefinition, TypeCompareKind.ConsiderEverything))
Symbols\TypeParameterSymbol.cs (2)
673return other.ContainingSymbol.ContainingType.Equals(this.ContainingSymbol.ContainingType, comparison);
Symbols\TypeSymbol.cs (20)
730var interfaceType = interfaceMember.ContainingType; 809NamedTypeSymbol interfaceType = interfaceMember.ContainingType; 1092return !symbolAndDiagnostics.Symbol.ContainingType.IsInterface; 1235NamedTypeSymbol implementingInterface = inplementingAccessor1.ContainingType; 1237if (implementingAccessor2 is object && !implementingInterface.Equals(implementingAccessor2.ContainingType, TypeCompareKind.ConsiderEverything)) 1282NamedTypeSymbol previousContainingType = previous.ContainingType; 1377NamedTypeSymbol containingType = interfaceMember.ContainingType; 1511currType.InterfacesAndTheirBaseInterfacesWithDefinitionUseSiteDiagnostics(ref useSiteInfo).ContainsKey(interfaceAccessor.ContainingType)) 1559if ((object)implementingPropertyOrEvent != null && !implementingPropertyOrEvent.ContainingType.IsInterface) 1590else if ((object)correspondingImplementingAccessor != null && ((object)implicitImpl == null || TypeSymbol.Equals(correspondingImplementingAccessor.ContainingType, implicitImpl.ContainingType, TypeCompareKind.ConsiderEverything2))) 1601interfaceMethod.ContainingType, 1722if (!implicitImpl.ContainingType.IsDefinition) 1724foreach (Symbol member in implicitImpl.ContainingType.GetMembers(implicitImpl.Name)) 2074var @interface = interfaceMember.ContainingType; 2132if (TypeSymbol.Equals(member.ContainingType, implementingType, TypeCompareKind.ConsiderEverything2)) 2138var @interface = interfaceMember.ContainingType; 2357x.ContainingType.Equals(y.ContainingType, TypeCompareKind.CLRSignatureCompareOptions); 2539if (elementField is not null && elementField.ContainingType.IsGenericType)
Symbols\TypeSymbolExtensions.cs (15)
782var containingType = current.ContainingType; 796RoslynDebug.Assert((object)current.ContainingType == null); 1042var parent1 = s1.ContainingType; 1052for (var parent2 = s2.ContainingType; (object)parent2 != null; parent2 = parent2.ContainingType) 1064var parent2 = s2.ContainingType; 1076var parent1 = s1.ContainingType; 1094for (var parent2 = s2.ContainingType; (object)parent2 != null; parent2 = parent2.ContainingType) 1117if (parent1.IsAccessibleViaInheritance(s2.ContainingType, ref useSiteInfo)) 1128parent1.IsAccessibleViaInheritance(s2.ContainingType, ref useSiteInfo)) 1139parent1.IsAccessibleViaInheritance(s2.ContainingType, ref useSiteInfo)) 1154NamedTypeSymbol parent1 = s1.ContainingType; 1162for (var parent2 = s2.ContainingType; (object)parent2 != null; parent2 = parent2.ContainingType) 2142if (typeSymbol.Name != name || typeSymbol.ContainingType is object) 2161=> typeSymbol.ContainingType is null && IsContainedInNamespace(typeSymbol, "System", "Runtime", "CompilerServices"); 2174=> typeSymbol.ContainingType is null && IsContainedInNamespace(typeSymbol, "System", "Diagnostics", "CodeAnalysis");
Symbols\VarianceSafety.cs (1)
98for (var container = member.ContainingType; container is object; container = container.ContainingType)