Base:
property
ContainingType
Microsoft.CodeAnalysis.CSharp.Symbol.ContainingType
3 overrides of ContainingType
Microsoft.CodeAnalysis.CSharp (3)
Symbols\Metadata\PE\PENamedTypeSymbol.cs (1)
861public override NamedTypeSymbol ContainingType
Symbols\Source\SourceMemberContainerSymbol.cs (1)
776public sealed override NamedTypeSymbol? ContainingType
Symbols\SubstitutedNamedTypeSymbol.cs (1)
131public override NamedTypeSymbol ContainingType
156 references to ContainingType
Microsoft.CodeAnalysis.CSharp (132)
Binder\Binder_Crefs.cs (5)
298|| nested is not { ContainingType: { ContainingType: null } }) // only consider extension blocks in top-level types 380NamedTypeSymbol? enclosingType = containingType.IsExtension ? containingType.ContainingType : containingType; 806NamedTypeSymbol containing = type.ContainingType; 813containing = containing.ContainingType;
Binder\Binder_Operators.cs (1)
1948NamedTypeSymbol extensionContainingType = signature.Method.OriginalDefinition.ContainingType.ContainingType;
Binder\BinderFactory.BinderFactoryVisitor.cs (1)
1338for (NamedTypeSymbol curr = outerBinder.ContainingType; (object)curr != null; curr = curr.ContainingType)
Binder\RefSafetyAnalysis.cs (1)
53type = def.ContainingType;
Binder\Semantics\AccessCheck.cs (4)
246var containingType = type.ContainingType; 332containingType.IsExtension && containingType.ContainingType is { } extensionEnclosingType ? extensionEnclosingType : containingType, 486current = current.ContainingType; 534current = current.ContainingType;
Binder\Semantics\Operators\UnaryOperatorOverloadResolution.cs (3)
253if (x.OriginalDefinition.ContainingType.ContainingType != (object)x.OriginalDefinition.ContainingType.ContainingType) 288int result = typeComparer.GetHashCode(op.OriginalDefinition.ContainingType.ContainingType);
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (1)
3205extension.ContainingType,
Binder\Semantics\OverloadResolution\OverloadResolution.cs (1)
1901? memberWithPriority.ContainingType.ContainingType
Compiler\ClsComplianceChecker.cs (3)
1070NamedTypeSymbol containingType = type.ContainingType; 1083containingType = containingType.ContainingType; 1106context = context.ContainingType;
Compiler\DocumentationCommentCompiler.cs (1)
227if (symbol.IsExtension && (SourceNamedTypeSymbol)symbol.ContainingType is { } containingType)
DocumentationComments\DocumentationCommentIDVisitor.PartVisitor.cs (1)
164for (NamedTypeSymbol curr = containingSymbol.ContainingType; (object)curr != null; curr = curr.ContainingType)
Emitter\Model\GenericNestedTypeInstanceReference.cs (1)
25return ((PEModuleBuilder)context.Module).Translate(UnderlyingNamedType.ContainingType, syntaxNodeOpt: (CSharpSyntaxNode)context.SyntaxNode, diagnostics: context.Diagnostics);
Emitter\Model\MethodSymbolAdapter.cs (4)
88return ((SourceMemberContainerTypeSymbol)containingType.ContainingType).GetExtensionGroupingInfo().GetCorrespondingMarkerType(marker); 92return ((SourceMemberContainerTypeSymbol)containingType.ContainingType).GetExtensionGroupingInfo().GetCorrespondingGroupingType((SourceNamedTypeSymbol)containingType); 315return ((SourceMemberContainerTypeSymbol)AdaptedMethodSymbol.ContainingType.ContainingType).GetExtensionGroupingInfo().GetCorrespondingMarkerType(marker); 320return ((SourceMemberContainerTypeSymbol)containingType.ContainingType).GetExtensionGroupingInfo().GetCorrespondingGroupingType((SourceNamedTypeSymbol)containingType);
Emitter\Model\NamedTypeSymbolAdapter.cs (12)
122(object)AdaptedNamedTypeSymbol.ContainingType == null) 137if ((object)AdaptedNamedTypeSymbol.ContainingType == null && 151if ((object)AdaptedNamedTypeSymbol.ContainingType != null) 173if ((object)AdaptedNamedTypeSymbol.ContainingType != null && 190(AdaptedNamedTypeSymbol.Arity == 0 || PEModuleBuilder.IsGenericType(AdaptedNamedTypeSymbol.ContainingType))) 192Debug.Assert((object)AdaptedNamedTypeSymbol.ContainingType != null && 193PEModuleBuilder.IsGenericType(AdaptedNamedTypeSymbol.ContainingType)); 844Debug.Assert((object)AdaptedNamedTypeSymbol.ContainingType == null && AdaptedNamedTypeSymbol.ContainingModule is SourceModuleSymbol); 858return moduleBeingBuilt.Translate(AdaptedNamedTypeSymbol.ContainingType, 868Debug.Assert((object)AdaptedNamedTypeSymbol.ContainingType != null); 871return AdaptedNamedTypeSymbol.ContainingType.GetCciAdapter(); 879Debug.Assert((object)AdaptedNamedTypeSymbol.ContainingType != null);
Emitter\Model\PEModuleBuilder.cs (4)
813Debug.Assert((object)originalDefinition.ContainingType == null, "How did a nested type get forwarded?"); 1168NamedTypeSymbol container = namedTypeSymbol.ContainingType; 1273toCheck = toCheck.ContainingType; 1632AddSynthesizedDefinition(result.ContainingType, result.GetCciAdapter());
Emitter\Model\PropertySymbolAdapter.cs (2)
227return ((SourceMemberContainerTypeSymbol)containingType.ContainingType).GetExtensionGroupingInfo().GetCorrespondingGroupingType((SourceNamedTypeSymbol)containingType); 254return ((SourceMemberContainerTypeSymbol)containingType.ContainingType).GetExtensionGroupingInfo().GetCorrespondingGroupingType((SourceNamedTypeSymbol)containingType);
Emitter\Model\SpecializedNestedTypeReference.cs (1)
43return ((PEModuleBuilder)context.Module).Translate(UnderlyingNamedType.ContainingType, (CSharpSyntaxNode)context.SyntaxNode, context.Diagnostics);
Emitter\NoPia\EmbeddedTypesManager.cs (1)
349if ((object)namedType.ContainingType != null)
Lowering\AsyncRewriter\AsyncMethodBuilderMemberCollection.cs (1)
350if (builderType.IsUnboundGenericType && builderType.ContainingType?.IsGenericType != true && builderType.Arity == 1)
Lowering\Instrumentation\CodeCoverageInstrumenter.cs (1)
153containingType = containingType.ContainingType;
Lowering\Instrumentation\LocalStateTracingInstrumenter.cs (2)
195if (type.ContainingType is null) 200type = type.ContainingType;
Lowering\SyntheticBoundNodeFactory.cs (1)
151ModuleBuilderOpt.AddSynthesizedDefinition(nestedType.ContainingType, nestedType.GetCciAdapter());
Symbols\AbstractTypeMap.cs (1)
29NamedTypeSymbol newContainingType = SubstituteNamedType(previous.ContainingType);
Symbols\AssemblySymbol.cs (2)
1067Debug.Assert((object)result.ContainingType == null || IsValidWellKnownType(result.ContainingType),
Symbols\BaseTypeAnalysis.cs (1)
58TypeDependsClosure(type.ContainingType, currentCompilation, partialClosure);
Symbols\Compilation_WellKnownMembers.cs (2)
1136if ((object)named.ContainingType != null) 1150if ((object)named.ContainingType != null)
Symbols\ConstructedNamedTypeSymbol.cs (1)
64map: new TypeMap(constructedFrom.ContainingType, constructedFrom.OriginalDefinition.TypeParameters, typeArgumentsWithAnnotations),
Symbols\ErrorTypeSymbol.cs (1)
678_map = new TypeMap(constructedFrom.ContainingType, constructedFrom.OriginalDefinition.TypeParameters, typeArgumentsWithAnnotations);
Symbols\ExtendedErrorTypeSymbol.cs (3)
300((object)this.ContainingType != null ? this.ContainingType.Equals(other.ContainingType, comparison) :
Symbols\Extensions\SynthesizedExtensionMarker.cs (1)
42return ((SourceMemberContainerTypeSymbol)ContainingType.ContainingType).GetExtensionGroupingInfo().GetCorrespondingMarkerMethodVisibility(this);
Symbols\Metadata\PE\DynamicTypeDecoder.cs (2)
224NamedTypeSymbol containingType = namedType.ContainingType; 228newContainingType = TransformNamedType(namedType.ContainingType, isContaining: true);
Symbols\Metadata\PE\MemberRefMetadataDecoder.cs (1)
93var containingType = namedType.ContainingType;
Symbols\Metadata\PE\MetadataDecoder.cs (1)
261namedType = namedType.ContainingType;
Symbols\Metadata\PE\SymbolFactory.cs (1)
123typeToCheck = typeToCheck.ContainingType;
Symbols\Metadata\PE\TupleTypeDecoder.cs (1)
259NamedTypeSymbol containingType = type.ContainingType;
Symbols\MissingMetadataTypeSymbol.cs (1)
124else if (ContainingType is ErrorTypeSymbol { ErrorInfo: { } info })
Symbols\NamedTypeSymbol.cs (13)
1017if ((object)this.ContainingType != null && 1018!this.ContainingType.Equals(other.ContainingType, comparison)) 1087ContainingType?.AddNullableTransforms(transforms); 1236definition = definition.ContainingType; 1241typeA = typeA.ContainingType; 1242typeB = typeB.ContainingType; 1408for (var current = this; !ReferenceEquals(current, null); current = current.ContainingType) 1439var outer = ContainingType; 1460var outer = ContainingType; 1471ContainingType?.GetAllTypeArgumentsNoUseSiteDiagnostics(builder); 1479var outer = ContainingType; 1565currentType = currentType.ContainingType;
Symbols\PublicModel\MethodSymbol.cs (1)
365var enclosing = _underlying.ContainingType.ContainingType;
Symbols\Retargeting\RetargetingSymbolTranslator.cs (10)
285var container = type.ContainingType; 295container = container.ContainingType; 449NamedTypeSymbol containingType = type.ContainingType; 510Debug.Assert((object)type.ContainingType == null || !type.ContainingType.IsUnboundGenericType()); 528genericType = genericType.ContainingType; 575genericType = genericType.ContainingType; 679namedType = namedType.ContainingType; 1065containingType = containingType.ContainingType; 1066retargetedContainingType = retargetedContainingType.ContainingType;
Symbols\Source\ParameterHelpers.cs (1)
535if (extension.ExtensionParameter is not { } extensionParameter || extension.ContainingType?.Arity != 0)
Symbols\Source\SourceAssemblySymbol.cs (1)
2841Debug.Assert((object)originalDefinition.ContainingType == null, "How did a nested type get forwarded?");
Symbols\Source\SourceMemberMethodSymbol.cs (1)
397if (containingType is { IsExtension: true, ContainingType: { } enclosing })
Symbols\Source\SourceMethodSymbolWithAttributes.cs (1)
1589for (NamedTypeSymbol curr = this.ContainingType; (object)curr != null; curr = curr.ContainingType)
Symbols\Source\SourceNamedTypeSymbol.cs (1)
2099if (ContainingType is null || !ContainingType.IsStatic || ContainingType.Arity != 0 || ContainingType.ContainingType is not null)
Symbols\Source\SourceNamedTypeSymbol_Extension.cs (2)
227if (namedType.ContainingType is { } containingType) 564if (namedType.ContainingType is { } containingType)
Symbols\Source\SourceOrdinaryMethodSymbol.cs (1)
230else if ((object)ContainingType.ContainingType != null)
Symbols\Source\SourcePropertySymbol.cs (2)
590if (containingType is { IsExtension: true, ContainingType: { } enclosing }) 673if (containingTypeForFileTypeCheck is { IsExtension: true, ContainingType: { } enclosing })
Symbols\SymbolExtensions.cs (3)
310while ((object?)upperLevelType.ContainingType != null) 312upperLevelType = upperLevelType.ContainingType; 840for (var current = symbol; current is not null; current = current.ContainingType)
Symbols\Tuples\TupleTypeSymbol.cs (1)
254Binder.ReportDiagnosticsIfObsoleteInternal(diagnostics, firstTupleType, syntax, firstTupleType.ContainingType, BinderFlags.None);
Symbols\TypeSymbolExtensions.cs (14)
1099for (var parent2 = s2.ContainingType; (object)parent2 != null; parent2 = parent2.ContainingType) 1141for (var parent2 = s2.ContainingType; (object)parent2 != null; parent2 = parent2.ContainingType) 1209for (var parent2 = s2.ContainingType; (object)parent2 != null; parent2 = parent2.ContainingType) 1235return (object)type.ContainingType == null; 1420ContainingType: null, 1433ContainingType: null, 1627code = Hash.Combine(type.ContainingType, code); 1673type = type.ContainingType; 1734if ((object)type.ContainingType == null) 1750var containingType = type.ContainingType; 1775type = type.ContainingType; 2182return typeSymbol is NamedTypeSymbol { Name: WellKnownMemberNames.LockTypeName, Arity: 0, ContainingType: null } && 2192ContainingType: null, 2226return type is NamedTypeSymbol { Name: "INumberBase", IsInterface: true, Arity: 1, ContainingType: null } &&
Symbols\TypeUnification.cs (4)
180return (object)nt1.ContainingType == null || CanUnifyHelper(nt1.ContainingType, nt2.ContainingType, ref substitution); 287namedType = namedType.ContainingType;
Symbols\UnboundGenericType.cs (1)
29NamedTypeSymbol originalContainingType = original.ContainingType;
Symbols\VarianceSafety.cs (2)
101for (var container = member.ContainingType; container is object; container = container.ContainingType) 421namedType = namedType.ContainingType;
Utilities\TypeSymbolExtensions.cs (2)
64namedType = namedType.ContainingType; 148namedType = namedType.ContainingType;
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (1)
CodeGen\CodeGenTupleTest.cs (1)
26971var container = contained.ContainingType;
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (4)
Semantics\ExtensionTests.cs (4)
24258var implM = underlying.ContainingType.GetMember<MethodSymbol>("M"); 24309var implM = underlying.ContainingType.GetMember<MethodSymbol>("M"); 24440var implM = symbol.ContainingType.GetMember<MethodSymbol>("M"); 24489var implM = underlying.ContainingType.GetMember<MethodSymbol>("M");
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (2)
Semantics\NullableReferenceTypesTests.cs (2)
115905var cDefinition = iDefinition.ContainingType; 115955var cDefinition = iDefinition.ContainingType;
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (17)
DocumentationComments\CrefTests.cs (1)
1709Assert.Equal(actualParameterType, actualWinner.ContainingType.ContainingType.TypeArguments().Single());
Symbols\CompilationCreationTests.cs (3)
2288var args1 = retval1.ContainingType.TypeArguments().Concat(retval1.TypeArguments()); 2289var params1 = retval1.ContainingType.TypeParameters.Concat(retval1.TypeParameters); 2298var retval2 = retval1.ContainingType;
Symbols\Metadata\PE\BaseTypeResolution.cs (2)
301Assert.Equal(base7.ContainingType, assembly1.CachedTypeByEmittedName(base7.ContainingType.ToTestDisplayString()));
Symbols\Source\TypeMapTests.cs (11)
61Assert.Equal(atbu, c.ContainingType); 62Assert.Equal(u, TypeArg(c.ContainingType)); 63Assert.Equal(at, c.ContainingType.ContainingType); 64Assert.Equal(t, TypeArg(c.ContainingType.ContainingType)); 73Assert.Equal(top, bf.ContainingType); 76Assert.Equal(ae, aebf.ContainingType); 80Assert.Equal(f, TypeArg(aebfc.ContainingType)); 81Assert.Equal(e, TypeArg(aebfc.ContainingType.ContainingType));