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)
418public override NamedTypeSymbol ContainingType => _containingType;
Symbols\Metadata\PE\PEPropertySymbol.cs (1)
312public override NamedTypeSymbol ContainingType
Symbols\NamedTypeSymbol.cs (1)
110public override NamedTypeSymbol ContainingType
Symbols\NamespaceSymbol.cs (1)
89public sealed override NamedTypeSymbol ContainingType
Symbols\Source\SourceEventSymbol.cs (1)
96public override NamedTypeSymbol ContainingType
Symbols\Source\SourceFieldSymbol.cs (1)
105public override NamedTypeSymbol ContainingType
Symbols\Source\SourceMemberMethodSymbol.cs (1)
399public override NamedTypeSymbol ContainingType
Symbols\Source\SourcePropertySymbolBase.cs (1)
436public override NamedTypeSymbol ContainingType
Symbols\SubstitutedFieldSymbol.cs (1)
46public override NamedTypeSymbol ContainingType
Symbols\SubstitutedMethodSymbol.cs (1)
197public 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)
145public override NamedTypeSymbol ContainingType
Symbols\Synthesized\SynthesizedFieldSymbolBase.cs (1)
150public override NamedTypeSymbol ContainingType
Symbols\Synthesized\SynthesizedGlobalMethodSymbol.cs (1)
85public sealed override NamedTypeSymbol ContainingType
Symbols\Synthesized\SynthesizedImplementationMethod.cs (1)
120public 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
638 references to ContainingType
Microsoft.CodeAnalysis.CSharp (504)
Binder\Binder.cs (1)
431_ => member.ContainingType
Binder\Binder.ValueChecks.cs (14)
957if (RequiresAssignableVariable(valueKind) && !backingField.ContainingType.IsReferenceType && (this.ContainingMemberOrLambda as MethodSymbol)?.IsEffectivelyReadOnly == true) 1184if (fieldSymbol.IsStatic || fieldSymbol.ContainingType.IsReferenceType) 1210? TypeSymbol.Equals(fieldSymbol.ContainingType, containing.ContainingType, TypeCompareKind.AllIgnoreOptions) 1212: TypeSymbol.Equals(fieldSymbol.ContainingType.OriginalDefinition, containing.ContainingType.OriginalDefinition, TypeCompareKind.AllIgnoreOptions))) 1267if (fieldSymbol.IsStatic || fieldSymbol.ContainingType.IsReferenceType) 1289if (fieldSymbol.IsStatic || fieldSymbol.ContainingType.IsReferenceType) 1314if (eventSymbol.IsStatic || eventSymbol.ContainingType.IsReferenceType) 2263return method.ContainingType.IsRefLikeType; 3001if (eventSymbol.IsStatic || eventSymbol.ContainingType.IsReferenceType) 3570if (fieldSymbol.IsStatic || !fieldSymbol.ContainingType.IsRefLikeType) 3995if (fieldSymbol.IsStatic || !fieldSymbol.ContainingType.IsRefLikeType) 4787if (!TypeSymbol.Equals(field.ContainingType, containingSymbol.ContainingSymbol as NamedTypeSymbol, TypeCompareKind.AllIgnoreOptions))
Binder\Binder_Await.cs (1)
157if (containingMemberOrLambda.ContainingType.IsScriptClass)
Binder\Binder_Expressions.cs (12)
50var containingType = memberOpt?.ContainingType; 1763var declaringType = members[0].ContainingType; 2073NamedTypeSymbol declaringType = member.ContainingType; 4119NamedTypeSymbol containingType = constructor.ContainingType; 4377if (resultMember is null || resultMember.ContainingType.SpecialType != SpecialType.System_Object) 4397return constructor.ContainingType is SourceNamedTypeSymbol sourceType && 5221if (constructor.ContainingType.HasRequiredMembersError) 5227var requiredMembers = constructor.ContainingType.AllRequiredMembers; 5622this.IsSymbolAccessibleConditional(constructor, containingType, ref useSiteInfo, constructor.ContainingType); 7438NamedTypeSymbol type = fieldSymbol.ContainingType; 7611if (symbol.ContainingType?.IsInterface == true) 8852return 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 (5)
886if (call.ReceiverOpt.Type.IsRestrictedType() && !TypeSymbol.Equals(call.Method.ContainingType, call.ReceiverOpt.Type, TypeCompareKind.ConsiderEverything2)) 888SymbolDistinguisher distinguisher = new SymbolDistinguisher(compilation, call.ReceiverOpt.Type, call.Method.ContainingType); 894SymbolDistinguisher distinguisher = new SymbolDistinguisher(compilation, this.ContainingType, call.Method.ContainingType); 1480TypeSymbol.Equals(containingMethod.ContainingType, method.ContainingType, TypeCompareKind.ConsiderEverything) &&
Binder\Binder_Lookup.cs (5)
1029((options & LookupOptions.NamespacesOrTypesOnly) == 0 || !(current.IsSingleViable && TypeSymbol.Equals(current.SingleSymbolOrDefault.ContainingType, type, TypeCompareKind.AllIgnoreOptions)))) // The nested type will shadow everything from bases 1238var hiddenContainer = sym.ContainingType; 1244var hidingContainer = hidingSym.ContainingType; 1253if (!IsDerivedType(baseType: hiddenContainer, derivedType: hidingSym.ContainingType, basesBeingResolved, this.Compilation, useSiteInfo: ref useSiteInfo) && 1341symbol = symbol.ContainingType;
Binder\Binder_Operators.cs (5)
999Debug.Assert(!(signature.Method?.ContainingType?.IsInterface ?? false)); 1119NamedTypeSymbol t = (NamedTypeSymbol)signature.Method.ContainingType; 1130SourceUserDefinedOperatorSymbol.IsSelfConstrainedTypeParameter((definition = signature.Method.OriginalDefinition).ReturnType.StrippedType(), definition.ContainingType)); 1347if (operatorMethod.ContainingType.IsInterface && 2353if (methodOpt?.ContainingType?.IsInterface == true && methodOpt.IsStatic)
Binder\Binder_Statements.cs (9)
1288((object)fixedPatternMethod == null || fixedPatternMethod.ContainingType.SpecialType != SpecialType.System_String)) 1758new CSDiagnosticInfo(ErrorCode.ERR_BadEventUsage, leastOverridden, leastOverridden.ContainingType) : 1769if (!propertySymbol.IsDefinition && propertySymbol.ContainingType.Equals(propertySymbol.ContainingType.OriginalDefinition, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)) 1779TypeSymbol.Equals(sourceProperty.ContainingType, fromMember.ContainingType, TypeCompareKind.AllIgnoreOptions) && 3712NamedTypeSymbol containingType = constructor.ContainingType; 3818NamedTypeSymbol baseType = constructor.ContainingType.BaseTypeNoUseSiteDiagnostics; 3847if (!AccessCheck.IsSymbolAccessible(baseConstructor, constructor.ContainingType, ref useSiteInfo)) 3858BoundExpression receiver = new BoundThisReference(syntax, constructor.ContainingType) { WasCompilerGenerated = true };
Binder\Binder_Symbols.cs (1)
1692symbol.MergeUseSiteInfo(ref info, symbol.ContainingType.GetUseSiteInfo());
Binder\DecisionDagBuilder.cs (2)
327var iTupleType = getLengthProperty.ContainingType; 362while (input.Source is BoundDagTypeEvaluation source && isDerivedType(source.Input.Type, symbol.ContainingType))
Binder\RefSafetyAnalysis.cs (1)
62var type = symbol.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)
244else if (method.ContainingType.IsNullableType() && !method.IsOverride) 364if (method.ContainingType.IsNullableType() && !method.IsOverride)
Binder\Semantics\Operators\BinaryOperatorOverloadResolution.cs (2)
811equalsIgnoringNullableAndDynamic(op.Signature.Method.ContainingType, existingSignature.Method.ContainingType))
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (1)
3019constructedFromMethod.ContainingType,
Binder\Semantics\OverloadResolution\OverloadResolution.cs (14)
675NamedTypeSymbol containingType = member.ContainingType; 883NamedTypeSymbol memberContainingType = member.ContainingType; 1057checkOverrideContainingType && !moreDerivedOverride.ContainingType.IsDerivedFrom(member.ContainingType, TypeCompareKind.ConsiderEverything, ref useSiteInfo) || 1091if (!member.ContainingType.IsClassType()) 1110NamedTypeSymbol memberContainingType = member.ContainingType; 1113NamedTypeSymbol otherContainingType = otherMember.ContainingType; 1278if (IsLessDerivedThanAny(result.LeastOverriddenMember.ContainingType, results, ref useSiteInfo)) 1298var currentType = result.LeastOverriddenMember.ContainingType; 1367var type = result.LeastOverriddenMember.ContainingType; 1389if (member.ContainingType.IsInterfaceType()) 2083if (m1.Member.ContainingType.TypeKind == TypeKind.Submission && m2.Member.ContainingType.TypeKind == TypeKind.Submission) 3568method.ContainingType,
BoundTree\Constructors.cs (3)
61!fieldSymbol.ContainingType.IsValueType || 203: this(syntax, constructor, ImmutableArray.Create<BoundExpression>(arguments), default(ImmutableArray<string>), default(ImmutableArray<RefKind>), false, default(ImmutableArray<int>), default(BitVector), null, null, constructor.ContainingType) 207: this(syntax, constructor, arguments, default(ImmutableArray<string>), default(ImmutableArray<RefKind>), false, default(ImmutableArray<int>), default(BitVector), null, null, constructor.ContainingType)
CodeGen\EmitConversion.cs (2)
353if (!method.IsStatic && method.IsMetadataVirtual() && !method.ContainingType.IsDelegateType() && !receiver.SuppressVirtualCalls) 360method = method.GetConstructedLeastOverriddenMethod(_method.ContainingType, requireSameReturnType: true);
CodeGen\EmitExpression.cs (13)
174var thisType = _method.ContainingType; 1099Debug.Assert(!field.IsConst || field.ContainingType.SpecialType == SpecialType.System_Decimal, 1605Debug.Assert(TypeSymbol.Equals(method.ContainingType, receiver.Type, TypeCompareKind.ConsiderEverything2)); 1610EmitSymbolToken(method.ContainingType, call.Syntax); 1677NamedTypeSymbol methodContainingType = method.ContainingType; 1734actualMethodTargetedByTheCall = method.GetConstructedLeastOverriddenMethod(_method.ContainingType, requireSameReturnType: true); 1737if (callKind == CallKind.ConstrainedCallVirt && actualMethodTargetedByTheCall.ContainingType.IsValueType) 1754if (IsThisReceiver(receiver) && actualMethodTargetedByTheCall.ContainingType.IsSealed && 2079Debug.Assert(method.ContainingType.IsVerifierValue(), "this is not a value type"); 2092var containingType = method.ContainingType; 2271if (originalDef.ContainingType.Name == NamedTypeSymbol.ValueTupleTypeName && 3430EmitSymbolToken(node.Method.ContainingType, node.Syntax); 3457EmitSymbolToken(node.Field.ContainingType, node.Syntax);
Compilation\CSharpCompilation.cs (2)
1829if (candidate.IsGenericMethod || candidate.ContainingType.IsGenericType) 2814return 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)
1285outer = outer.GetFieldInitializerBinder(symbol, suppressBinderFlagsFieldInitializer: !this.IsRegularCSharp && symbol.ContainingType.IsScriptClass);
Compiler\ClsComplianceChecker.cs (10)
323CheckParameterCompliance(symbol.Parameters, symbol.ContainingType); 324CheckTypeParameterCompliance(symbol.TypeParameters, symbol.ContainingType); 368CheckParameterCompliance(symbol.Parameters, symbol.ContainingType); 494NamedTypeSymbol containingType = symbol.ContainingType; 538NamedTypeSymbol containingType = symbol.ContainingType; 731System.Diagnostics.Debug.Assert(method.ContainingType.TypeKind == TypeKind.Delegate); 732symbol = method.ContainingType; // Refer to the delegate type in diagnostics. 753if (!IsCompliantType(type, symbol.ContainingType)) 1167Symbol containing = (Symbol)symbol.ContainingType ?? symbol.ContainingAssembly; 1221symbol = symbol.ContainingType;
Compiler\DocumentationCommentCompiler.cs (3)
286var symbolForDocComments = symbol is SynthesizedRecordPropertySymbol ? symbol.ContainingType : symbol; 665symbol = symbol.ContainingType; 1093diagnostics.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 }; 95var thisReference = new BoundThisReference(syntax, submissionConstructor.ContainingType) { WasCompilerGenerated = true }; 542method.ContainingType) 588NamedTypeSymbol 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)
236synthesizedEntryPoint = new SynthesizedEntryPointSymbol.AsyncForwardEntryPoint(compilation, entryPoint.ContainingType, entryPoint); 240moduleBeingBuilt.AddSynthesizedDefinition(entryPoint.ContainingType, synthesizedEntryPoint.GetCciAdapter()); 268new TypeCompilationState(synthesizedEntryPoint.ContainingType, compilation, moduleBeingBuilt), 946if (methodSymbol.IsAbstract || methodSymbol.ContainingType?.IsDelegateType() == true) 1070Debug.Assert(!prependedDefaultValueTypeConstructorInitializer || methodSymbol.ContainingType.IsStructType()); 1084((methodSymbol.ContainingType.IsStructType() && !methodSymbol.IsImplicitConstructor) || 1432method.ContainingType, 1459method.ContainingType, 1477method.ContainingType, 1790if (method is SynthesizedPrimaryConstructor primaryCtor && method.ContainingType.IsStructType()) 2273Debug.Assert(!method.ContainingType.IsDelegateType()); 2298if (ctorCall != null && !ctorCall.HasAnyErrors && ctorCall.Method != method && TypeSymbol.Equals(ctorCall.Method.ContainingType, method.ContainingType, TypeCompareKind.ConsiderEverything2))
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)
743var otherType = (NamedTypeSymbol?)Visit(member.ContainingType);
Emitter\Model\EventSymbolAdapter.cs (2)
106return AdaptedEventSymbol.ContainingType.GetCciAdapter(); 126return AdaptedEventSymbol.ContainingType.GetCciAdapter();
Emitter\Model\FieldSymbolAdapter.cs (2)
94return moduleBeingBuilt.Translate(AdaptedFieldSymbol.ContainingType, 273return AdaptedFieldSymbol.ContainingType.GetCciAdapter();
Emitter\Model\MethodSymbolAdapter.cs (8)
55(!AdaptedMethodSymbol.IsGenericMethod || PEModuleBuilder.IsGenericType(AdaptedMethodSymbol.ContainingType))) 57Debug.Assert((object)AdaptedMethodSymbol.ContainingType != null && 58PEModuleBuilder.IsGenericType(AdaptedMethodSymbol.ContainingType)); 81NamedTypeSymbol containingType = AdaptedMethodSymbol.ContainingType; 271NamedTypeSymbol container = AdaptedMethodSymbol.ContainingType; 309return AdaptedMethodSymbol.ContainingType.GetCciAdapter(); 612return this.IsExtern || (object)ContainingType != null && ContainingType.TypeKind == TypeKind.Delegate;
Emitter\Model\NamedTypeSymbolAdapter.cs (1)
384Debug.Assert(body.ContainingType == (object)container);
Emitter\Model\PEModuleBuilder.cs (7)
1165else if (!needDeclaration && IsGenericType(fieldSymbol.ContainingType)) 1208if (symbol.ContainingType?.TypeKind == TypeKind.Submission) 1230if (symbol.ContainingType.TypeKind == TypeKind.Submission) 1241Debug.Assert(symbol.ContainingType.TypeKind != TypeKind.Submission); 1307NamedTypeSymbol container = methodSymbol.ContainingType; 1381NamedTypeSymbol container = methodSymbol.ContainingType; 1489IsGenericType(container.ContainingType);
Emitter\Model\PropertySymbolAdapter.cs (2)
220return AdaptedPropertySymbol.ContainingType.GetCciAdapter(); 240return 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)
438var containerKind = field.AdaptedFieldSymbol.ContainingType.TypeKind; 445ReportNotEmbeddableSymbol(ErrorCode.ERR_InteropStructContainsMethods, field.AdaptedFieldSymbol.ContainingType, syntaxNodeOpt, diagnostics, this); 599NamedTypeSymbol namedType = member.AdaptedSymbol.ContainingType;
FlowAnalysis\AbstractFlowPass.cs (1)
2063fieldSymbol.ContainingType.TypeKind == TypeKind.Struct &&
FlowAnalysis\DefiniteAssignment.cs (5)
103&& CurrentSymbol is MethodSymbol { MethodKind: MethodKind.Constructor, ContainingType.TypeKind: TypeKind.Struct }; 1214Debug.Assert(CurrentSymbol is MethodSymbol { MethodKind: MethodKind.Constructor, ContainingType.TypeKind: TypeKind.Struct }); 1220foreach (var field in _emptyStructTypeCache.GetStructInstanceFields(thisParameter.ContainingType)) 1261if (CurrentSymbol is not MethodSymbol { MethodKind: MethodKind.Constructor, ContainingType.TypeKind: TypeKind.Struct }) 1425if (fieldSymbol.ContainingType.IsReferenceType || fieldSymbol.IsStatic) return null;
FlowAnalysis\FlowAnalysisPass.cs (1)
113Debug.Assert(method.ContainingType.IsStructType());
FlowAnalysis\LocalDataFlowPass.cs (2)
165TypeSymbol containingType = symbol.ContainingType; 172while (!TypeSymbol.Equals(containingType, symbol.ContainingType, TypeCompareKind.ConsiderEverything))
FlowAnalysis\NullableWalker.cs (30)
617? method.ContainingType.GetMembersUnordered().SelectManyAsArray( 627foreach (var member in method.ContainingType.GetMembersUnordered()) 642if (chainedConstructorEnforcesRequiredMembers && !constructorEnforcesRequiredMembers && method.ContainingType.BaseTypeNoUseSiteDiagnostics is { } baseType) 760foreach (var member in method.ContainingType.GetMembers(memberName)) 789enforceMemberNotNullWhenIfAffected(returnStatement.Syntax, sense: true, method.ContainingType.GetMembers(memberName), pendingReturn.StateWhenTrue, pendingReturn.StateWhenFalse); 794enforceMemberNotNullWhenIfAffected(returnStatement.Syntax, sense: false, method.ContainingType.GetMembers(memberName), pendingReturn.StateWhenFalse, pendingReturn.StateWhenTrue); 823foreach (var member in method.ContainingType.GetMembers(memberName)) 962&& (!method.ContainingType.IsValueType 966return membersToBeInitialized(method.ContainingType, includeAllMembers: true, includeCurrentTypeRequiredMembers, includeBaseRequiredMembers); 971return membersToBeInitialized(method.ContainingType, includeAllMembers: method.IncludeFieldInitializersInBody(), includeCurrentTypeRequiredMembers, includeBaseRequiredMembers); 1033foreach (var member in property.ContainingType.GetMembers(notNullMemberName)) 1057var type = method.ContainingType; 1359&& method.ContainingType is SourceMemberContainerTypeSymbol containingType) 2544TypeSymbol possibleBase = possibleMember.ContainingType; 3391(FieldSymbol { ContainingType: { IsTupleType: true }, TupleElementIndex: var oi } originalField, FieldSymbol { ContainingType: { IsTupleType: true }, TupleElementIndex: var ui } updatedField) => 3576var containingType = constructor?.ContainingType; 4650TypeSymbol methodContainer = method.ContainingType; 5032var containingType = this._symbol?.ContainingType; 5774var wellKnownType = wellKnownMethod.ContainingType; 5795if (implementationMethod.ContainingType.IsInterface) 5826while (!baseType.Equals(implementationMethod.ContainingType) && method is object) 5828if (baseType.Equals(method.ContainingType)) 5842if (method is object && baseType.Equals(method.ContainingType)) 5970method.ContainingType.IsReferenceType) 6386var type = method.ContainingType; 7055definition.ContainingType, 7352var symbolContainer = symbol.ContainingType; 7364Debug.Assert(symbol.ContainingType.IsDefinition); 9927if ((object)getMethod != null && getMethod.ContainingType.SpecialType == SpecialType.System_Nullable_T)
FlowAnalysis\ReadWriteWalker.cs (1)
168if (expr.FieldSymbol.ContainingType.IsReferenceType) return;
Lowering\AsyncRewriter\AsyncExceptionHandlerRewriter.cs (2)
38Debug.Assert(TypeSymbol.Equals(factory.CurrentType, (containingType ?? containingMethod.ContainingType), TypeCompareKind.ConsiderEverything2)); 436exceptionDispatchInfoCapture.ContainingType,
Lowering\AsyncRewriter\AsyncMethodToStateMachineRewriter.cs (1)
418? F.StaticCall(methodSymbol.ContainingType, methodSymbol, receiver)
Lowering\ClosureConversion\ClosureConversion.cs (10)
320get { return _topLevelMethod.ContainingType; } 424translatedLambdaContainer = _topLevelMethod.ContainingType; 445translatedLambdaContainer = _topLevelMethod.ContainingType; 451Debug.Assert((object)translatedLambdaContainer != _topLevelMethod.ContainingType || 666Debug.Assert(TypeSymbol.Equals(frameType, constructor.ContainingType, TypeCompareKind.ConsiderEverything2)); 834return (!_currentMethod.IsStatic && TypeSymbol.Equals(_currentMethod.ContainingType, _topLevelMethod.ContainingType, TypeCompareKind.ConsiderEverything2)) 836: FramePointer(node.Syntax, _topLevelMethod.ContainingType); // technically, not the correct static type 1004var translatedLambdaContainer = synthesizedMethod.ContainingType; 1046receiver = new BoundTypeExpression(syntax, null, synthesizedMethod.ContainingType);
Lowering\DiagnosticsPass_ExpressionTrees.cs (2)
267Binder.ReportDiagnosticsIfObsolete(_diagnostics, node.EventSymbol.AssociatedField, node.Syntax, hasBaseReceiver, _containingSymbol, _containingSymbol.ContainingType, BinderFlags.None); 281Binder.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\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)
65Debug.Assert(TypeSymbol.Equals(factory.CurrentType, (containingType ?? containingMethod.ContainingType), TypeCompareKind.ConsiderEverything2)); 802if (!lhsField.IsStatic && lhsField.ContainingType.IsStructType())
Lowering\LocalRewriter\LocalRewriter.DecisionDagRewriter.cs (1)
176!method.ContainingType.SpecialType.IsPrimitiveRecursiveStruct();
Lowering\LocalRewriter\LocalRewriter.PatternLocalRewriter.cs (1)
175receiver = _factory.Type(method.ContainingType);
Lowering\LocalRewriter\LocalRewriter_Call.cs (4)
49NamedTypeSymbol firstContainer = node.ApplicableMethods.First().ContainingType; 50Debug.Assert(node.ApplicableMethods.All(m => !m.RequiresInstanceReceiver && TypeSymbol.Equals(m.ContainingType, firstContainer, TypeCompareKind.ConsiderEverything2))); 219method.ContainingType.IsObjectType() && 1031methodOrIndexer.ContainingType;
Lowering\LocalRewriter\LocalRewriter_CompoundAssignmentOperator.cs (3)
366if (indexer.ContainingType.IsComImport) 478var memberContainingType = fieldOrEvent.ContainingType; 904if (method.ContainingType?.IsNullableType() == true)
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (2)
561var receiver = (!method.RequiresInstanceReceiver && !oldNodeOpt.IsExtensionMethod && !method.IsAbstract && !method.IsVirtual) ? _factory.Type(method.ContainingType) : mg.ReceiverOpt; 1713Debug.Assert(!meth.ContainingType.IsInterface);
Lowering\LocalRewriter\LocalRewriter_DelegateCreationExpression.cs (1)
33var 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; 268_diagnostics.Add(new CSDiagnosticInfo(ErrorCode.ERR_MissingPredefinedMember, invocationListProperty.ContainingType, accessorName), syntax.Location); 300BoundExpression eventInfo = _factory.New(ctor, _factory.Typeof(node.Event.ContainingType), _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)
271idisposableTypeSymbol = disposeMethod.ContainingType; 451if (!receiver.Type.IsReferenceType && method.ContainingType.IsInterface)
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)
192if (method.IsStatic && method.ContainingType.SpecialType == SpecialType.System_String)
Lowering\LocalRewriter\LocalRewriter_ObjectCreationExpression.cs (2)
76rewrittenObjectCreation = node.UpdateArgumentsAndInitializer(rewrittenArguments, argumentRefKindsOpt, MakeObjectCreationInitializerForExpressionTree(node.InitializerExpressionOpt), changeTypeOpt: node.Constructor.ContainingType); 87rewrittenObjectCreation = node.UpdateArgumentsAndInitializer(rewrittenArguments, argumentRefKindsOpt, newInitializerExpression: null, changeTypeOpt: node.Constructor.ContainingType);
Lowering\LocalRewriter\LocalRewriter_ObjectOrCollectionInitializerExpression.cs (1)
505Debug.Assert(_compilation.Conversions.ClassifyConversionFromType(rewrittenReceiver.Type, memberSymbol.ContainingType, isChecked: false, ref discardedUseSiteInfo).IsImplicit);
Lowering\LocalRewriter\LocalRewriter_StringConcat.cs (1)
161if (method.IsStatic && method.ContainingType.SpecialType == SpecialType.System_String)
Lowering\LocalRewriter\LoweredDynamicOperationFactory.cs (1)
610return _factory.ArrayOrEmpty(argumentInfoFactory.ContainingType, infos);
Lowering\MethodToClassRewriter.cs (13)
539.AsMember((NamedTypeSymbol)this.VisitType(node.Field.ContainingType)); 548.AsMember((NamedTypeSymbol)this.VisitType(node.FieldSymbol.ContainingType)); 614if (method.ContainingType is null) 619else if (method.ContainingType.IsAnonymousType) 622var newType = (NamedTypeSymbol)TypeMap.SubstituteType(method.ContainingType).AsTypeSymbolOnly(); 623if (ReferenceEquals(newType, method.ContainingType)) 644.AsMember((NamedTypeSymbol)TypeMap.SubstituteType(method.ContainingType).AsTypeSymbolOnly()) 657if (!property.ContainingType.IsAnonymousType) 661.AsMember((NamedTypeSymbol)TypeMap.SubstituteType(property.ContainingType).AsTypeSymbolOnly()); 665var newType = (NamedTypeSymbol)TypeMap.SubstituteType(property.ContainingType).AsTypeSymbolOnly(); 666if (ReferenceEquals(newType, property.ContainingType)) 688.AsMember((NamedTypeSymbol)TypeMap.SubstituteType(field.ContainingType).AsTypeSymbolOnly()); 741TypeMap? typeMap = methodBeingWrapped.ContainingType is SubstitutedNamedTypeSymbol substitutedType ? substitutedType.TypeSubstitution : TypeMap.Empty;
Lowering\SpillSequenceSpiller.cs (2)
420var receiver = Spill(builder, field.ReceiverOpt, fieldSymbol.ContainingType.IsValueType ? refKind : RefKind.None); 853if (field.FieldSymbol.ContainingType.IsReferenceType)
Lowering\StateMachineRewriter\IteratorAndAsyncCaptureWalker.cs (2)
64if (!method.IsStatic && method.ContainingType.TypeKind == TypeKind.Struct) 216case BoundFieldAccess { FieldSymbol: { IsStatic: false, ContainingType: { IsValueType: true } }, ReceiverOpt: BoundExpression receiver }:
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (2)
188get { return OriginalMethod.ContainingType; } 581var isFieldOfStruct = !field.FieldSymbol.ContainingType.IsReferenceType;
Lowering\StateMachineRewriter\StateMachineRewriter.cs (2)
63Debug.Assert(TypeSymbol.Equals(F.CurrentType, method.ContainingType, TypeCompareKind.ConsiderEverything2)); 235var 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 (8)
74_currentType = value.ContainingType; 151: this(topLevelMethod, topLevelMethod.ContainingType, node, compilationState, diagnostics, instrumentationState) 181Debug.Assert(TopLevelMethod is null || TypeSymbol.Equals(TopLevelMethod.ContainingType, CurrentType, TypeCompareKind.ConsiderEverything2)); 190TypeSymbol.Equals(CurrentFunction.ContainingType, CurrentType, TypeCompareKind.ConsiderEverything2)); 1221GetMethodFromHandleMethod(ctor.ContainingType), 1308if (!method.ContainingType.IsValueType || !Microsoft.CodeAnalysis.CSharp.CodeGen.CodeGenerator.MayUseCallForStructMethod(method)) 1316GetMethodFromHandleMethod(method.ContainingType), 1326GetFieldFromHandleMethod(field.ContainingType),
Operations\CSharpOperationFactory.cs (1)
2466boundITuplePattern.GetLengthMethod.ContainingType.GetPublicSymbol(),
Symbols\AnonymousTypes\AnonymousTypeManager.SymbolCollection.cs (1)
101ReportErrorOnSymbol(symbol.ContainingType, diagnostics, ref hasError);
Symbols\AnonymousTypes\AnonymousTypeManager.Templates.cs (1)
779NamedTypeSymbol translatedType = TranslateAnonymousTypeSymbol(method.ContainingType);
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.FieldSymbol.cs (2)
107get { return _property.ContainingType; } 114return _property.ContainingType;
Symbols\ConstructedMethodSymbol.cs (2)
19: base(containingSymbol: constructedFrom.ContainingType, 20map: new TypeMap(constructedFrom.ContainingType, ((MethodSymbol)constructedFrom.OriginalDefinition).TypeParameters, typeArgumentsWithAnnotations),
Symbols\ErrorTypeSymbol.ErrorTypeParameterSymbol.cs (2)
189other.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 (5)
776Debug.Assert(TypeSymbol.Equals(propertyOrEventSymbol.ContainingType, _containingType, TypeCompareKind.ConsiderEverything2)); 1270if (!method.ContainingType.IsInterface) 1274(method.ContainingType.SpecialType == SpecialType.System_Object && 1292if (method.ContainingType.IsInterface) 1303if (method.ContainingType.IsClassType())
Symbols\Metadata\PE\PEParameterSymbol.cs (2)
294typeSymbol = NativeIntegerTypeDecoder.TransformType(typeSymbol, handle, moduleSymbol, containingSymbol.ContainingType); 1133PEPropertySymbol => new MetadataDecoder(containingModule, (PENamedTypeSymbol)ContainingType),
Symbols\MethodSymbol.cs (6)
363internal virtual bool IsEffectivelyReadOnly => (IsDeclaredReadOnly || ContainingType?.IsReadOnly == true) && IsValidReadOnlyTarget; 365protected bool IsValidReadOnlyTarget => !IsStatic && ContainingType.IsStructType() && MethodKind != MethodKind.Constructor && !IsInitOnly; 651return MethodKind == MethodKind.Constructor && ContainingType.IsScriptClass; 809return this.ContainingType; 1037if (isGenericMethod(this) || ContainingType.IsGenericType) 1220if (methodToAttribute.ShouldCheckRequiredMembers() && methodToAttribute.ContainingType.HasAnyRequiredMembers)
Symbols\MethodSymbolExtensions.cs (2)
61else if (method.ContainingType.SpecialType == SpecialType.System_Object) 219method.ContainingType?.IsStructType() == true &&
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)
155(refKind == RefKind.Ref && ContainingSymbol.ContainingType.IsComImport));
Symbols\PropertySymbol.cs (5)
168var property = (PropertySymbol)this.GetLeastOverriddenMember(this.ContainingType); 180var property = (PropertySymbol)this.GetLeastOverriddenMember(this.ContainingType); 448return TypeSymbol.Equals(this.ContainingType, other.ContainingType, compareKind) && ReferenceEquals(this.OriginalDefinition, other.OriginalDefinition); 454hash = 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)
910var containingType = method.ContainingType; 958var containingType = property.ContainingType; 974var containingType = @event.ContainingType; 1078NamedTypeSymbol containingType = _toFind.ContainingType; 1201newAttributeType = 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)
480if (symbol.ContainingType?.IsInterface == true && !symbol.ContainingAssembly.RuntimeSupportsDefaultInterfaceImplementation) 496case FieldSymbol when !symbol.IsAsRestrictive(symbol.ContainingType, ref useSiteInfo): 497case PropertySymbol { SetMethod: { } method } when !method.IsAsRestrictive(symbol.ContainingType, ref useSiteInfo): 499diagnostics.Add(ErrorCode.ERR_RequiredMemberCannotBeLessVisibleThanContainingType, errorLocation, symbol, symbol.ContainingType);
Symbols\Source\ParameterHelpers.cs (2)
646Debug.Assert(containingSymbol is null || (containingSymbol is FunctionPointerMethodSymbol or { ContainingType: not null })); 649ErrorFacts.GetStaticClassParameterCode(containingSymbol?.ContainingType?.IsInterfaceType() ?? false),
Symbols\Source\SourceAssemblySymbol.cs (5)
2206if ((object)forwardedType.ContainingType != null) 2208diagnostics.Add(ErrorCode.ERR_ForwardedTypeIsNested, GetAssemblyAttributeLocationForDiagnostic(arguments.AttributeSyntaxOpt), forwardedType, forwardedType.ContainingType); 2568var container = field.ContainingType as SourceMemberContainerTypeSymbol; 2662var containingType = field.ContainingType as SourceNamedTypeSymbol; 2719var containingType = field.ContainingType as SourceNamedTypeSymbol;
Symbols\Source\SourceEventAccessorSymbol.cs (1)
49name = ExplicitInterfaceHelpers.GetMemberName(accessorName, explicitlyImplementedEventOpt.ContainingType, aliasQualifierOpt);
Symbols\Source\SourceMemberContainerSymbol.cs (2)
871for (Symbol? container = this.ContainingType; !(container is null); container = container.ContainingType) 2556if (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); 1049var overridingType = overridingProperty.ContainingType; 1549if (!hidingMember.ContainingType.IsInterface) 1609if (!hiddenMember.IsAbstract || !hidingMember.ContainingType.IsAbstract) 1787IsOverrideOfPossibleImplementationUnderRuntimeRules(implementingMethod, @interfaceMethod.ContainingType)) 1811if (implementingMethod.ContainingType != (object)this) 1813if (implementingMethod.ContainingType.IsInterface || 1852NamedTypeSymbol type = implementingMethod.ContainingType;
Symbols\Source\SourceMethodSymbol.cs (1)
48else if (ContainingType is SourceMemberContainerTypeSymbol type)
Symbols\Source\SourceMethodSymbolWithAttributes.cs (11)
567CSharpAttributeData.DecodeMemberNotNullAttribute<MethodWellKnownAttributeData>(ContainingType, ref arguments); 572CSharpAttributeData.DecodeMemberNotNullWhenAttribute<MethodWellKnownAttributeData>(ContainingType, ref arguments); 664else if (this.ContainingType.IsInterfaceType()) 783if (isAnyNestedMethodGeneric || ContainingType?.IsGenericType == true) 894Debug.Assert(ContainingType is object); 912if (IsGenericMethod || ContainingType.IsGenericType) 1048diagnostics.Add(ErrorCode.ERR_ComImportWithImpl, this.Locations[0], this, ContainingType); 1060&& !this.ContainingType.IsComImport) 1116for (NamedTypeSymbol curr = this.ContainingType; (object)curr != null; curr = curr.ContainingType) 1208return this.ContainingType.IsInterface && 1298if (this.ContainingType.IsComImport && this.MethodKind == MethodKind.Constructor)
Symbols\Source\SourceNamedTypeSymbol.cs (1)
230diagnostics.Add(ErrorCode.WRN_TypeParameterSameAsOuterTypeParameter, location, name, tpEnclosing.ContainingType);
Symbols\Source\SourceOrdinaryMethodSymbol.cs (1)
579diagnostics.Add(ErrorCode.WRN_TypeParameterSameAsOuterTypeParameter, location, name, tpEnclosing.ContainingType);
Symbols\Source\SourcePropertyAccessorSymbol.cs (1)
673name = ExplicitInterfaceHelpers.GetMemberName(accessorName, explicitlyImplementedPropertyOpt.ContainingType, aliasQualifierOpt);
Symbols\Source\SynthesizedAttributeData.cs (1)
19attributeClass: wellKnownMember.ContainingType,
Symbols\Source\ThisParameterSymbol.cs (2)
17internal ThisParameterSymbol(MethodSymbol forMethod) : this(forMethod, forMethod.ContainingType) 39if (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 (3)
43Debug.Assert(TypeSymbol.Equals(originalDefinition.ContainingType, containingSymbol.OriginalDefinition, TypeCompareKind.ConsiderEverything2)); 369if (containingHashCode == this.OriginalDefinition.ContainingType.GetHashCode() && 437if (!TypeSymbol.Equals(this.ContainingType, other.ContainingType, compareKind)) return false;
Symbols\Symbol.cs (2)
134return container.ContainingType; 245return this.ContainingType;
Symbols\SymbolExtensions.cs (4)
41return symbol is NamedTypeSymbol && (object?)symbol.ContainingType != null; 180type = symbol.ContainingType; 310var upperLevelType = symbol.Kind == SymbolKind.NamedType ? (NamedTypeSymbol)symbol : symbol.ContainingType; 534return !symbol.IsSealed && (symbol.IsAbstract || symbol.IsVirtual) && (symbol.ContainingType?.IsInterface ?? false);
Symbols\Synthesized\Records\SynthesizedPrimaryConstructorParameterBackingFieldSymbol.cs (1)
66=> ParameterSymbol.ContainingSymbol.ContainingType;
Symbols\Synthesized\Records\SynthesizedRecordBaseEquals.cs (1)
54!overridden.ContainingType.Equals(ContainingType.BaseTypeNoUseSiteDiagnostics, TypeCompareKind.AllIgnoreOptions))
Symbols\Synthesized\Records\SynthesizedRecordCopyCtor.cs (2)
120if (member is MethodSymbol { ContainingType.IsRecordStruct: false, MethodKind: MethodKind.Constructor } method) 130NamedTypeSymbol containingType = member.ContainingType;
Symbols\Synthesized\Records\SynthesizedRecordEqualityContractProperty.cs (4)
97if (overriding.ContainingType.BaseTypeNoUseSiteDiagnostics.IsObjectType()) 113!overridden.ContainingType.Equals(overriding.ContainingType.BaseTypeNoUseSiteDiagnostics, TypeCompareKind.AllIgnoreOptions)) 121diagnostics.Add(ErrorCode.ERR_DoesNotOverrideBaseEqualityContract, overriding.Locations[0], overriding, overriding.ContainingType.BaseTypeNoUseSiteDiagnostics);
Symbols\Synthesized\Records\SynthesizedRecordEquals.cs (2)
113if (baseEquals is null || !baseEquals.ContainingType.Equals(ContainingType.BaseTypeNoUseSiteDiagnostics, TypeCompareKind.AllIgnoreOptions) || 130F.Base(baseEquals.ContainingType),
Symbols\Synthesized\Records\SynthesizedRecordGetHashCode.cs (1)
90currentHashValue = F.Call(F.Base(overridden.ContainingType), overridden);
Symbols\Synthesized\Records\SynthesizedRecordObjectMethod.cs (1)
49if (overridden is object && !(overridden.ContainingType is SourceMemberContainerTypeSymbol { IsRecord: true } && overridden.ContainingModule == overriding.ContainingModule))
Symbols\Synthesized\Records\SynthesizedRecordPrintMembers.cs (3)
111!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)
95parameter.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)
46Debug.Assert(container.Equals(underlyingField.ContainingType, TypeCompareKind.IgnoreDynamicAndTupleNames) || this is TupleVirtualElementFieldSymbol, 107NamedTypeSymbol originalContainer = ContainingType.OriginalDefinition; 267Debug.Assert(underlyingField.ContainingType.IsTupleType); 269Debug.Assert(name != underlyingField.Name || !container.Equals(underlyingField.ContainingType, TypeCompareKind.IgnoreDynamicAndTupleNames),
Symbols\Tuples\TupleTypeSymbol.cs (1)
1119if (TypeSymbol.Equals(underlyingMemberDefinition.ContainingType, TupleUnderlyingType.OriginalDefinition, TypeCompareKind.ConsiderEverything))
Symbols\TypeParameterSymbol.cs (2)
666return other.ContainingSymbol.ContainingType.Equals(this.ContainingSymbol.ContainingType, comparison);
Symbols\TypeSymbol.cs (20)
728var interfaceType = interfaceMember.ContainingType; 807NamedTypeSymbol interfaceType = interfaceMember.ContainingType; 1090return !symbolAndDiagnostics.Symbol.ContainingType.IsInterface; 1233NamedTypeSymbol implementingInterface = inplementingAccessor1.ContainingType; 1235if (implementingAccessor2 is object && !implementingInterface.Equals(implementingAccessor2.ContainingType, TypeCompareKind.ConsiderEverything)) 1280NamedTypeSymbol previousContainingType = previous.ContainingType; 1316if (bases.ContainsKey(implementations[i].MethodSet.First().ContainingType)) 1375NamedTypeSymbol containingType = interfaceMember.ContainingType; 1509currType.InterfacesAndTheirBaseInterfacesWithDefinitionUseSiteDiagnostics(ref useSiteInfo).ContainsKey(interfaceAccessor.ContainingType)) 1557if ((object)implementingPropertyOrEvent != null && !implementingPropertyOrEvent.ContainingType.IsInterface) 1588else if ((object)correspondingImplementingAccessor != null && ((object)implicitImpl == null || TypeSymbol.Equals(correspondingImplementingAccessor.ContainingType, implicitImpl.ContainingType, TypeCompareKind.ConsiderEverything2))) 1599interfaceMethod.ContainingType, 1710if (!implicitImpl.ContainingType.IsDefinition) 1712foreach (Symbol member in implicitImpl.ContainingType.GetMembers(implicitImpl.Name)) 2032var @interface = interfaceMember.ContainingType; 2090if (TypeSymbol.Equals(member.ContainingType, implementingType, TypeCompareKind.ConsiderEverything2)) 2096var @interface = interfaceMember.ContainingType; 2315x.ContainingType.Equals(y.ContainingType, TypeCompareKind.CLRSignatureCompareOptions);
Symbols\TypeSymbolExtensions.cs (15)
703var containingType = current.ContainingType; 717RoslynDebug.Assert((object)current.ContainingType == null); 954var parent1 = s1.ContainingType; 964for (var parent2 = s2.ContainingType; (object)parent2 != null; parent2 = parent2.ContainingType) 976var parent2 = s2.ContainingType; 988var parent1 = s1.ContainingType; 1006for (var parent2 = s2.ContainingType; (object)parent2 != null; parent2 = parent2.ContainingType) 1029if (parent1.IsAccessibleViaInheritance(s2.ContainingType, ref useSiteInfo)) 1040parent1.IsAccessibleViaInheritance(s2.ContainingType, ref useSiteInfo)) 1051parent1.IsAccessibleViaInheritance(s2.ContainingType, ref useSiteInfo)) 1066NamedTypeSymbol parent1 = s1.ContainingType; 1074for (var parent2 = s2.ContainingType; (object)parent2 != null; parent2 = parent2.ContainingType) 2041if (typeSymbol.Name != name || typeSymbol.ContainingType is object) 2060=> typeSymbol.ContainingType is null && IsContainedInNamespace(typeSymbol, "System", "Runtime", "CompilerServices"); 2073=> typeSymbol.ContainingType is null && IsContainedInNamespace(typeSymbol, "System", "Diagnostics", "CodeAnalysis");
Symbols\VarianceSafety.cs (1)
98for (var container = member.ContainingType; container is object; container = container.ContainingType)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (20)
CodeGen\CodeGenTupleTest.cs (16)
11252Assert.True(m1Item1.ContainingType.OriginalDefinition.TupleElements[0].Equals(m1Item1.OriginalDefinition, TypeCompareKind.ConsiderEverything)); 11272Assert.True(m2Item1.ContainingType.OriginalDefinition.TupleElements[0].Equals(m2Item1.OriginalDefinition, TypeCompareKind.ConsiderEverything)); 11295Assert.True(m2a2.ContainingType.OriginalDefinition.TupleElements[0].Equals(m1Item1.OriginalDefinition, TypeCompareKind.ConsiderEverything)); 12801Assert.True(m1Item1.ContainingType.OriginalDefinition.TupleElements[0].Equals(m1Item1.OriginalDefinition, TypeCompareKind.ConsiderEverything)); 12820Assert.True(m2Item1.ContainingType.OriginalDefinition.TupleElements[0].Equals(m2Item1.OriginalDefinition, TypeCompareKind.ConsiderEverything)); 13456Assert.True(sym.ContainingType.IsTupleType); 13465Assert.True(sym.ContainingType.IsTupleType); 13474Assert.True(sym.ContainingType.IsTupleType); 27104var toEmit = field.ContainingType.GetFieldsToEmit().Where(f => f.Name == "F1").Single(); 27188var toEmit = field.ContainingType.GetFieldsToEmit().Where(f => f.Name == "F1").Single(); 27262var toEmit = field.ContainingType.GetFieldsToEmit().Single(); 27340var toEmit = field.ContainingType.GetFieldsToEmit().Single(); 28673Assert.Same(tuple, item1Underlying.ContainingType); 28801Assert.Equal(isSourceSymbol ? "SourceNamedTypeSymbol" : "PENamedTypeSymbolGeneric", underlying.ContainingType.GetType().Name); 28812Assert.Equal("ConstructedNamedTypeSymbol", underlying.ContainingType.GetType().Name); 28972Assert.Equal("ConstructedNamedTypeSymbol", underlying.ContainingType.GetType().Name);
Emit\EmitMetadataTests.cs (4)
1182var containingType = property.ContainingType; 1184Assert.Equal(containingType, accessor.ContainingType); 1302var backingField = property.ContainingType.GetField(GeneratedNames.MakeBackingFieldName(property.Name)); 1317var method = property.ContainingType.GetMembers(accessor.Name).Single();
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ExpressionCompiler (23)
CompilationContext.cs (9)
385if (!m.IsStatic && !IsDisplayClassType(m.ContainingType) || 937var substitutedSourceType = substitutedSourceMethod.ContainingType; 1291var containingType = method.ContainingType; 1369if (IsDisplayClassType(currentFrame.ContainingType) && !currentFrame.IsStatic) 1424possiblyCapturingType: currentFrame.ContainingType, 1440possiblyCapturingType: currentFrame.ContainingType, 1512Debug.Assert((object)possiblyCapturingType == currentFrame.ContainingType); 1720else if (variableKind != DisplayClassVariableKind.This || GeneratedNameParser.GetKind(instance.Type.ContainingType.Name) != GeneratedNameKind.LambdaDisplayClass) 1805var candidateSubstitutedSourceType = candidateSubstitutedSourceMethod.ContainingType;
CSharpCompileResult.cs (1)
21: base(assembly, method.ContainingType.MetadataName, method.MetadataName, formatSpecifiers)
CSharpInstructionDecoder.cs (1)
124var substitutedType = typeMap.SubstituteNamedType(method.ContainingType);
EvaluationContext.cs (2)
307Debug.Assert(synthesizedMethod.ContainingType.MetadataName == TypeName); 391Debug.Assert(synthesizedMethod.ContainingType.MetadataName == TypeName);
Rewriters\LocalDeclarationRewriter.cs (2)
126return new BoundDefaultExpression(syntax, targetType: null, constantValueOpt: null, guidConstructor.ContainingType); 133new BoundLiteral(syntax, value, guidConstructor.ContainingType));
SymbolExtensions.cs (1)
17method.ContainingType.GetAllTypeParameters(builder);
Symbols\DisplayClassVariable.cs (1)
106return new EEDisplayClassFieldSymbol(typeMap.SubstituteNamedType(field.ContainingType), field.Name, typeMap.SubstituteType(field.TypeWithAnnotations));
Symbols\EECompilationContextMethod.cs (1)
37var typeMap = underlyingMethod.ContainingType.TypeSubstitution ?? TypeMap.Empty;
Symbols\EEMethodSymbol.cs (2)
141Debug.Assert(TypeSymbol.Equals(_thisParameter.Type, this.SubstitutedSourceMethod.ContainingType, TypeCompareKind.ConsiderEverything2)); 656thisType: this.SubstitutedSourceMethod.ContainingType,
Symbols\EENamedTypeSymbol.cs (2)
53_typeParameters = getTypeParameters(currentFrame.ContainingType, this); 78var sourceType = currentFrame.ContainingType;
Symbols\ObjectIdLocalSymbol.cs (1)
76method.ContainingType,
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ExpressionCompiler.UnitTests (7)
ExpressionCompilerTestBase.cs (2)
397VerifyTypeParameters(method.ContainingType); 525var typeName = method.ContainingType.Name;
ExpressionCompilerTests.cs (1)
2086var containingType = method.ContainingType;
LocalsTests.cs (4)
1766var containingType = method.ContainingType; 1801containingType = method.ContainingType; 1816containingType = method.ContainingType; 1900var containingType = method.ContainingType;
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (13)
Semantics\NativeIntegerTests.cs (1)
498Assert.Same(type, member.ContainingType);
Semantics\RecordTests.cs (8)
3447Assert.True(clone.ContainingType.IsSealed); 3448Assert.True(clone.ContainingType.IsAbstract); 3478Assert.True(clone.ContainingType.IsSealed); 3479Assert.True(clone.ContainingType.IsAbstract); 3510Assert.True(clone.ContainingType.IsSealed); 3511Assert.True(clone.ContainingType.IsAbstract); 3537Assert.True(clone.ContainingType.IsSealed); 3538Assert.True(clone.ContainingType.IsAbstract);
Semantics\RefFieldTests.cs (1)
2018var containingType = fieldReferences[0].ContainingType;
Semantics\TopLevelStatementsTests.cs (3)
9492Assert.False(field.ContainingType.IsImplicitlyDeclared); 9501field.ContainingType.GetMembers().ToTestDisplayStrings()); 9510field.ContainingType.GetMembers().ToTestDisplayStrings());
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (67)
DocumentationComments\CrefTests.cs (5)
1670AssertEx.All(actualWinner.ContainingType.TypeArguments(), typeParam => TypeSymbol.Equals(typeParam, actualParameterType, TypeCompareKind.ConsiderEverything2)); //CONSIDER: Would be different in Dev11. 1675Assert.Equal(actualWinner.ContainingType.GetMembers(actualWinner.Name).Single(member => member != actualWinner), actualCandidates[1]); 1708Assert.Equal(actualParameterType, actualWinner.ContainingType.TypeArguments().Single()); 1709Assert.Equal(actualParameterType, actualWinner.ContainingType.ContainingType.TypeArguments().Single()); 1713Assert.Equal(actualWinner.ContainingType.GetMembers(actualWinner.Name).Single(member => member != actualWinner), actualCandidates[1]);
Symbols\CompilationCreationTests.cs (1)
2517Assert.Null(module3.ContainingType);
Symbols\DefaultInterfaceImplementationTests.cs (15)
34668Assert.NotSame(test1i1, test1i1m1.ContainingType); 34669Assert.NotSame(test1i1, test1i1m2.ContainingType); 34670Assert.NotSame(test2i1, test2i1m1.ContainingType); 34671Assert.NotSame(test2i1, test2i1m2.ContainingType); 34672Assert.NotSame(test2i2, test2i2m1.ContainingType); 34673Assert.NotSame(test2i2, test2i2m2.ContainingType); 38962Assert.NotSame(test1i1, test1i1m1.ContainingType); 38963Assert.NotSame(test2i1, test2i1m1.ContainingType); 38964Assert.NotSame(test2i2, test2i2m1.ContainingType); 41638Assert.NotSame(test1i1, test1i1m1.ContainingType); 41639Assert.NotSame(test2i1, test2i1m1.ContainingType); 41640Assert.NotSame(test2i2, test2i2m1.ContainingType); 50917Assert.Equal("I1", i1m1.ContainingType.Name); 68699Assert.Equal("I1", i1m1.ContainingType.Name); 68784Assert.Equal("I1", i1m1.ContainingType.Name);
Symbols\Metadata\MetadataMemberTests.cs (2)
260Assert.Equal(class1, p1.ContainingType); 355Assert.Equal(type1, p2.ContainingType);
Symbols\Metadata\PE\LoadingEvents.cs (2)
362var @interface = interfaceEvent.ContainingType; 371Assert.Equal(@interface, innerClassImplementingEvent.ContainingType.ConstructedFrom);
Symbols\Metadata\PE\LoadingGenericTypeParameters.cs (5)
50Assert.Equal(varC1, varC1_T.ContainingType); 87Assert.Equal(varC2, varC2_T.ContainingType); 102Assert.Equal(varC4, varC4_T.ContainingType); 117Assert.Equal(varTC2, varTC2_T1.ContainingType); 121Assert.Equal(varTC2, varTC2_T2.ContainingType);
Symbols\Metadata\PE\LoadingMethods.cs (2)
733var @interface = interfaceMethod.ContainingType; 742Assert.Equal(@interface, innerClassImplementingMethod.ContainingType.ConstructedFrom);
Symbols\Metadata\PE\LoadingProperties.cs (2)
197var @interface = interfaceProperty.ContainingType; 206Assert.Equal(@interface, innerClassImplementingProperty.ContainingType.ConstructedFrom);
Symbols\Metadata\PE\NoPiaLocalHideAndTypeSubstitutionTests.cs (1)
352Assert.Same(canonicalType, explicitImpl.ContainingType);
Symbols\OverriddenOrHiddenMembersTests.cs (3)
2921p.DeclaredAccessibility == (p.ContainingType.Name == "A" ? Accessibility.ProtectedOrInternal : Accessibility.Protected)); 2969p.DeclaredAccessibility == (p.ContainingType.Name == "A" ? Accessibility.ProtectedOrInternal : Accessibility.Protected)); 3285e.DeclaredAccessibility == (e.ContainingType.Name == "A" ? Accessibility.ProtectedOrInternal : Accessibility.Protected));
Symbols\RequiredMembersTests.cs (1)
61requiredTypes.Add((NamedTypeSymbol)member.ContainingType);
Symbols\Retargeting\RetargetExplicitInterfaceImplementation.cs (3)
90Assert.Equal(interfaceV1, method.ExplicitInterfaceImplementations.Single().ContainingType); 94Assert.Equal(interfaceV1, ((PropertySymbol)member).ExplicitInterfaceImplementations.Single().ContainingType); 97Assert.Equal(interfaceV1, ((EventSymbol)member).ExplicitInterfaceImplementations.Single().ContainingType);
Symbols\Source\CustomModifierCopyTests.cs (3)
413Assert.Same(baseClass, explicitImpl.ImplementingMethod.ContainingType); 426Assert.Same(baseClass, class2Method2SynthesizedExplicitImpl.ImplementingMethod.ContainingType); 448Assert.Same(baseClass, class3Method2SynthesizedExplicitImpl.ImplementingMethod.ContainingType);
Symbols\Source\MethodTests.cs (1)
1823Assert.Equal(substitutedInterface, explicitImpl.ContainingType);
Symbols\Source\PropertyTests.cs (4)
597Assert.Equal(type, accessor.ContainingType); 2516Assert.Equal(interfacePropertyGetter.ContainingType, getterOverride.ImplementedMethod.GetContainingType(context).GetInternalSymbol()); 2521Assert.Equal(interfacePropertySetter.ContainingType, setterOverride.ImplementedMethod.GetContainingType(context).GetInternalSymbol()); 2554Assert.Equal(interfacePropertyGetter.ContainingType, getterOverride.ImplementedMethod.GetContainingType(context).GetInternalSymbol());
Symbols\Source\RecordTests.cs (4)
174Assert.Equal(c, getAccessor.ContainingType); 181Assert.Equal(c, setAccessor.ContainingType); 208Assert.Equal(c, getAccessor.ContainingType); 214Assert.Equal(c, setAccessor.ContainingType);
Symbols\StaticAbstractMembersInInterfacesTests.cs (12)
4148Assert.Null(m01.ContainingType.FindImplementationForInterfaceMember(m01)); 4161Assert.Null(m01.ContainingType.FindImplementationForInterfaceMember(m01)); 4174Assert.Null(m01.ContainingType.FindImplementationForInterfaceMember(m01)); 4394Assert.Null(m01.ContainingType.FindImplementationForInterfaceMember(m01)); 4407Assert.Null(m01.ContainingType.FindImplementationForInterfaceMember(m01)); 4420Assert.Null(m01.ContainingType.FindImplementationForInterfaceMember(m01)); 4580Assert.Same(m01, m01.ContainingType.FindImplementationForInterfaceMember(m01)); 4593Assert.Same(m01, m01.ContainingType.FindImplementationForInterfaceMember(m01)); 4606Assert.Null(m01.ContainingType.FindImplementationForInterfaceMember(m01)); 4820Assert.Same(m01, m01.ContainingType.FindImplementationForInterfaceMember(m01)); 4833Assert.Same(m01, m01.ContainingType.FindImplementationForInterfaceMember(m01)); 4846Assert.Null(m01.ContainingType.FindImplementationForInterfaceMember(m01));
Symbols\SymbolExtensionTests.cs (1)
259method.ContainingType.VisitType(static (typeSymbol, typeParameters, _) =>
Microsoft.CodeAnalysis.CSharp.Test.Utilities (4)
CompilingTestBase.cs (1)
36TypeCompilationState compilationState = new TypeCompilationState(method.ContainingType, compilation, module);
Extensions.cs (1)
530Assert.Contains(accessor, propertyOrEvent.ContainingType.GetMembers(accessor.Name));
TestAttributesVisitor.cs (1)
211var containingType = attribute.AttributeConstructor!.ContainingType;
UsesIsNullableVisitor.cs (1)
175if (UsesIsNullable(type.ContainingType, inProgress))