Base:
property
ContainingType
Microsoft.CodeAnalysis.CSharp.Symbol.ContainingType
3 overrides of ContainingType
Microsoft.CodeAnalysis.CSharp (3)
Symbols\Metadata\PE\PENamedTypeSymbol.cs (1)
839
public override NamedTypeSymbol
ContainingType
Symbols\Source\SourceMemberContainerSymbol.cs (1)
776
public sealed override NamedTypeSymbol?
ContainingType
Symbols\SubstitutedNamedTypeSymbol.cs (1)
131
public override NamedTypeSymbol
ContainingType
157 references to ContainingType
Microsoft.CodeAnalysis.CSharp (133)
Binder\Binder_Crefs.cs (5)
298
|| nested is not {
ContainingType
: {
ContainingType
: null } }) // only consider extension blocks in top-level types
379
NamedTypeSymbol? enclosingType = containingType.IsExtension ? containingType.
ContainingType
: containingType;
805
NamedTypeSymbol containing = type.
ContainingType
;
812
containing = containing.
ContainingType
;
Binder\Binder_Operators.cs (3)
1847
signature.Method.OriginalDefinition.ContainingType.
ContainingType
.GetExtensionMembers(extensionCandidates,
1859
signature.Method.OriginalDefinition.ContainingType.
ContainingType
.GetExtensionMembers(extensionCandidates,
1873
Error(diagnostics, ErrorCode.ERR_MustHaveOpTF, syntax, signature.Method, signature.Method.OriginalDefinition.ContainingType.
ContainingType
);
Binder\BinderFactory.BinderFactoryVisitor.cs (1)
1329
for (NamedTypeSymbol curr = outerBinder.ContainingType; (object)curr != null; curr = curr.
ContainingType
)
Binder\RefSafetyAnalysis.cs (1)
52
type = def.
ContainingType
;
Binder\Semantics\AccessCheck.cs (4)
246
var containingType = type.
ContainingType
;
332
containingType.IsExtension && containingType.
ContainingType
is { } extensionEnclosingType ? extensionEnclosingType : containingType,
486
current = current.
ContainingType
;
534
current = current.
ContainingType
;
Binder\Semantics\Operators\UnaryOperatorOverloadResolution.cs (3)
253
if (x.OriginalDefinition.ContainingType.
ContainingType
!= (object)x.OriginalDefinition.ContainingType.
ContainingType
)
288
int result = typeComparer.GetHashCode(op.OriginalDefinition.ContainingType.
ContainingType
);
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (1)
3205
extension.
ContainingType
,
Binder\Semantics\OverloadResolution\OverloadResolution.cs (1)
1894
? memberWithPriority.ContainingType.
ContainingType
Compiler\ClsComplianceChecker.cs (3)
1070
NamedTypeSymbol containingType = type.
ContainingType
;
1083
containingType = containingType.
ContainingType
;
1106
context = context.
ContainingType
;
Compiler\DocumentationCommentCompiler.cs (1)
227
if (symbol.IsExtension && (SourceNamedTypeSymbol)symbol.
ContainingType
is { } containingType)
DocumentationComments\DocumentationCommentIDVisitor.PartVisitor.cs (1)
164
for (NamedTypeSymbol curr = containingSymbol.ContainingType; (object)curr != null; curr = curr.
ContainingType
)
Emitter\Model\GenericNestedTypeInstanceReference.cs (1)
25
return ((PEModuleBuilder)context.Module).Translate(UnderlyingNamedType.
ContainingType
, syntaxNodeOpt: (CSharpSyntaxNode)context.SyntaxNode, diagnostics: context.Diagnostics);
Emitter\Model\MethodSymbolAdapter.cs (4)
88
return ((SourceMemberContainerTypeSymbol)containingType.
ContainingType
).GetExtensionGroupingInfo().GetCorrespondingMarkerType(marker);
92
return ((SourceMemberContainerTypeSymbol)containingType.
ContainingType
).GetExtensionGroupingInfo().GetCorrespondingGroupingType((SourceNamedTypeSymbol)containingType);
315
return ((SourceMemberContainerTypeSymbol)AdaptedMethodSymbol.ContainingType.
ContainingType
).GetExtensionGroupingInfo().GetCorrespondingMarkerType(marker);
320
return ((SourceMemberContainerTypeSymbol)containingType.
ContainingType
).GetExtensionGroupingInfo().GetCorrespondingGroupingType((SourceNamedTypeSymbol)containingType);
Emitter\Model\NamedTypeSymbolAdapter.cs (12)
122
(object)AdaptedNamedTypeSymbol.
ContainingType
== null)
137
if ((object)AdaptedNamedTypeSymbol.
ContainingType
== null &&
151
if ((object)AdaptedNamedTypeSymbol.
ContainingType
!= null)
173
if ((object)AdaptedNamedTypeSymbol.
ContainingType
!= null &&
190
(AdaptedNamedTypeSymbol.Arity == 0 || PEModuleBuilder.IsGenericType(AdaptedNamedTypeSymbol.
ContainingType
)))
192
Debug.Assert((object)AdaptedNamedTypeSymbol.
ContainingType
!= null &&
193
PEModuleBuilder.IsGenericType(AdaptedNamedTypeSymbol.
ContainingType
));
844
Debug.Assert((object)AdaptedNamedTypeSymbol.
ContainingType
== null && AdaptedNamedTypeSymbol.ContainingModule is SourceModuleSymbol);
858
return moduleBeingBuilt.Translate(AdaptedNamedTypeSymbol.
ContainingType
,
868
Debug.Assert((object)AdaptedNamedTypeSymbol.
ContainingType
!= null);
871
return AdaptedNamedTypeSymbol.
ContainingType
.GetCciAdapter();
879
Debug.Assert((object)AdaptedNamedTypeSymbol.
ContainingType
!= null);
Emitter\Model\PEModuleBuilder.cs (4)
811
Debug.Assert((object)originalDefinition.
ContainingType
== null, "How did a nested type get forwarded?");
1166
NamedTypeSymbol container = namedTypeSymbol.
ContainingType
;
1271
toCheck = toCheck.
ContainingType
;
1630
AddSynthesizedDefinition(result.
ContainingType
, result.GetCciAdapter());
Emitter\Model\PropertySymbolAdapter.cs (2)
227
return ((SourceMemberContainerTypeSymbol)containingType.
ContainingType
).GetExtensionGroupingInfo().GetCorrespondingGroupingType((SourceNamedTypeSymbol)containingType);
254
return ((SourceMemberContainerTypeSymbol)containingType.
ContainingType
).GetExtensionGroupingInfo().GetCorrespondingGroupingType((SourceNamedTypeSymbol)containingType);
Emitter\Model\SpecializedNestedTypeReference.cs (1)
43
return ((PEModuleBuilder)context.Module).Translate(UnderlyingNamedType.
ContainingType
, (CSharpSyntaxNode)context.SyntaxNode, context.Diagnostics);
Emitter\NoPia\EmbeddedTypesManager.cs (1)
298
if ((object)namedType.
ContainingType
!= null)
Lowering\AsyncRewriter\AsyncMethodBuilderMemberCollection.cs (1)
350
if (builderType.IsUnboundGenericType && builderType.
ContainingType
?.IsGenericType != true && builderType.Arity == 1)
Lowering\Instrumentation\CodeCoverageInstrumenter.cs (1)
153
containingType = containingType.
ContainingType
;
Lowering\Instrumentation\LocalStateTracingInstrumenter.cs (2)
195
if (type.
ContainingType
is null)
200
type = type.
ContainingType
;
Lowering\SyntheticBoundNodeFactory.cs (1)
151
ModuleBuilderOpt.AddSynthesizedDefinition(nestedType.
ContainingType
, nestedType.GetCciAdapter());
Symbols\AbstractTypeMap.cs (1)
29
NamedTypeSymbol newContainingType = SubstituteNamedType(previous.
ContainingType
);
Symbols\AssemblySymbol.cs (2)
1053
Debug.Assert((object)result.
ContainingType
== null || IsValidWellKnownType(result.
ContainingType
),
Symbols\BaseTypeAnalysis.cs (1)
58
TypeDependsClosure(type.
ContainingType
, currentCompilation, partialClosure);
Symbols\Compilation_WellKnownMembers.cs (2)
1120
if ((object)named.
ContainingType
!= null)
1134
if ((object)named.
ContainingType
!= null)
Symbols\ConstructedNamedTypeSymbol.cs (1)
64
map: new TypeMap(constructedFrom.
ContainingType
, constructedFrom.OriginalDefinition.TypeParameters, typeArgumentsWithAnnotations),
Symbols\ErrorTypeSymbol.cs (1)
676
_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)
42
return ((SourceMemberContainerTypeSymbol)ContainingType.
ContainingType
).GetExtensionGroupingInfo().GetCorrespondingMarkerMethodVisibility(this);
Symbols\Metadata\PE\DynamicTypeDecoder.cs (2)
224
NamedTypeSymbol containingType = namedType.
ContainingType
;
228
newContainingType = TransformNamedType(namedType.
ContainingType
, isContaining: true);
Symbols\Metadata\PE\MemberRefMetadataDecoder.cs (1)
93
var containingType = namedType.
ContainingType
;
Symbols\Metadata\PE\MetadataDecoder.cs (1)
261
namedType = namedType.
ContainingType
;
Symbols\Metadata\PE\SymbolFactory.cs (1)
123
typeToCheck = typeToCheck.
ContainingType
;
Symbols\Metadata\PE\TupleTypeDecoder.cs (1)
259
NamedTypeSymbol containingType = type.
ContainingType
;
Symbols\MissingMetadataTypeSymbol.cs (1)
124
else if (
ContainingType
is ErrorTypeSymbol { ErrorInfo: { } info })
Symbols\NamedTypeSymbol.cs (13)
988
if ((object)this.
ContainingType
!= null &&
989
!this.
ContainingType
.Equals(other.
ContainingType
, comparison))
1058
ContainingType
?.AddNullableTransforms(transforms);
1207
definition = definition.
ContainingType
;
1212
typeA = typeA.
ContainingType
;
1213
typeB = typeB.
ContainingType
;
1379
for (var current = this; !ReferenceEquals(current, null); current = current.
ContainingType
)
1410
var outer =
ContainingType
;
1431
var outer =
ContainingType
;
1442
ContainingType
?.GetAllTypeArgumentsNoUseSiteDiagnostics(builder);
1450
var outer =
ContainingType
;
1536
currentType = currentType.
ContainingType
;
Symbols\PublicModel\MethodSymbol.cs (1)
352
var enclosing = _underlying.ContainingType.
ContainingType
;
Symbols\Retargeting\RetargetingSymbolTranslator.cs (10)
285
var container = type.
ContainingType
;
295
container = container.
ContainingType
;
449
NamedTypeSymbol containingType = type.
ContainingType
;
510
Debug.Assert((object)type.
ContainingType
== null || !type.
ContainingType
.IsUnboundGenericType());
528
genericType = genericType.
ContainingType
;
575
genericType = genericType.
ContainingType
;
679
namedType = namedType.
ContainingType
;
1065
containingType = containingType.
ContainingType
;
1066
retargetedContainingType = retargetedContainingType.
ContainingType
;
Symbols\Source\ParameterHelpers.cs (1)
535
if (extension.ExtensionParameter is not { } extensionParameter || extension.
ContainingType
.Arity != 0)
Symbols\Source\SourceAssemblySymbol.cs (1)
2839
Debug.Assert((object)originalDefinition.
ContainingType
== null, "How did a nested type get forwarded?");
Symbols\Source\SourceMemberMethodSymbol.cs (1)
397
if (containingType is { IsExtension: true,
ContainingType
: { } enclosing })
Symbols\Source\SourceMethodSymbolWithAttributes.cs (1)
1569
for (NamedTypeSymbol curr = this.ContainingType; (object)curr != null; curr = curr.
ContainingType
)
Symbols\Source\SourceNamedTypeSymbol.cs (1)
2007
if (ContainingType is null || !ContainingType.IsStatic || ContainingType.Arity != 0 || ContainingType.
ContainingType
is not null)
Symbols\Source\SourceNamedTypeSymbol_Extension.cs (2)
227
if (namedType.
ContainingType
is { } containingType)
564
if (namedType.
ContainingType
is { } containingType)
Symbols\Source\SourceOrdinaryMethodSymbol.cs (1)
228
else if ((object)ContainingType.
ContainingType
!= null)
Symbols\Source\SourcePropertySymbol.cs (2)
591
if (containingType is { IsExtension: true,
ContainingType
: { } enclosing })
674
if (containingTypeForFileTypeCheck is { IsExtension: true,
ContainingType
: { } enclosing })
Symbols\SymbolExtensions.cs (2)
309
while ((object?)upperLevelType.
ContainingType
!= null)
311
upperLevelType = upperLevelType.
ContainingType
;
Symbols\Tuples\TupleTypeSymbol.cs (1)
254
Binder.ReportDiagnosticsIfObsoleteInternal(diagnostics, firstTupleType, syntax, firstTupleType.
ContainingType
, BinderFlags.None);
Symbols\TypeSymbolExtensions.cs (14)
1054
for (var parent2 = s2.ContainingType; (object)parent2 != null; parent2 = parent2.
ContainingType
)
1096
for (var parent2 = s2.ContainingType; (object)parent2 != null; parent2 = parent2.
ContainingType
)
1164
for (var parent2 = s2.ContainingType; (object)parent2 != null; parent2 = parent2.
ContainingType
)
1190
return (object)type.
ContainingType
== null;
1375
ContainingType
: null,
1388
ContainingType
: null,
1582
code = Hash.Combine(type.
ContainingType
, code);
1628
type = type.
ContainingType
;
1689
if ((object)type.
ContainingType
== null)
1705
var containingType = type.
ContainingType
;
1730
type = type.
ContainingType
;
2137
return typeSymbol is NamedTypeSymbol { Name: WellKnownMemberNames.LockTypeName, Arity: 0,
ContainingType
: null } &&
2147
ContainingType
: null,
2181
return type is NamedTypeSymbol { Name: "INumberBase", IsInterface: true, Arity: 1,
ContainingType
: null } &&
Symbols\TypeUnification.cs (4)
180
return (object)nt1.
ContainingType
== null || CanUnifyHelper(nt1.
ContainingType
, nt2.
ContainingType
, ref substitution);
287
namedType = namedType.
ContainingType
;
Symbols\UnboundGenericType.cs (1)
29
NamedTypeSymbol originalContainingType = original.
ContainingType
;
Symbols\VarianceSafety.cs (2)
101
for (var container = member.ContainingType; container is object; container = container.
ContainingType
)
421
namedType = namedType.
ContainingType
;
Utilities\TypeSymbolExtensions.cs (2)
64
namedType = namedType.
ContainingType
;
148
namedType = namedType.
ContainingType
;
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (1)
CodeGen\CodeGenTupleTest.cs (1)
26971
var container = contained.
ContainingType
;
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (4)
Semantics\ExtensionTests.cs (4)
23898
var implM = underlying.
ContainingType
.GetMember<MethodSymbol>("M");
23949
var implM = underlying.
ContainingType
.GetMember<MethodSymbol>("M");
24080
var implM = symbol.
ContainingType
.GetMember<MethodSymbol>("M");
24129
var implM = underlying.
ContainingType
.GetMember<MethodSymbol>("M");
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (2)
Semantics\NullableReferenceTypesTests.cs (2)
115855
var cDefinition = iDefinition.
ContainingType
;
115905
var cDefinition = iDefinition.
ContainingType
;
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (17)
DocumentationComments\CrefTests.cs (1)
1709
Assert.Equal(actualParameterType, actualWinner.ContainingType.
ContainingType
.TypeArguments().Single());
Symbols\CompilationCreationTests.cs (3)
2288
var args1 = retval1.
ContainingType
.TypeArguments().Concat(retval1.TypeArguments());
2289
var params1 = retval1.
ContainingType
.TypeParameters.Concat(retval1.TypeParameters);
2298
var retval2 = retval1.
ContainingType
;
Symbols\Metadata\PE\BaseTypeResolution.cs (2)
301
Assert.Equal(base7.
ContainingType
, assembly1.CachedTypeByEmittedName(base7.
ContainingType
.ToTestDisplayString()));
Symbols\Source\TypeMapTests.cs (11)
61
Assert.Equal(atbu, c.
ContainingType
);
62
Assert.Equal(u, TypeArg(c.
ContainingType
));
63
Assert.Equal(at, c.
ContainingType
.
ContainingType
);
64
Assert.Equal(t, TypeArg(c.
ContainingType
.
ContainingType
));
73
Assert.Equal(top, bf.
ContainingType
);
76
Assert.Equal(ae, aebf.
ContainingType
);
80
Assert.Equal(f, TypeArg(aebfc.
ContainingType
));
81
Assert.Equal(e, TypeArg(aebfc.
ContainingType
.
ContainingType
));