Base:
property
ContainingType
Microsoft.CodeAnalysis.CSharp.Symbol.ContainingType
114 references to ContainingType
Microsoft.CodeAnalysis.CSharp (114)
Lowering\ClosureConversion\ClosureConversion.cs (1)
1525
translatedLambdaContainer = synthesizedMethod.
ContainingType
;
Lowering\ClosureConversion\SynthesizedClosureMethod.cs (1)
54
var lambdaFrame =
ContainingType
as SynthesizedClosureEnvironment;
Lowering\SynthesizedMethodBaseSymbol.cs (1)
80
if (
ContainingType
.IsImplicitlyDeclared)
Symbols\Source\SourceConstructorSymbol.cs (4)
171
else if (
ContainingType
.IsSealed && this.DeclaredAccessibility.HasProtected() && !this.IsOverride)
173
diagnostics.Add(AccessCheck.GetProtectedMemberInSealedTypeError(
ContainingType
), location, this);
175
else if (
ContainingType
.IsStatic && methodKind == MethodKind.Constructor)
189
: ((SourceMemberContainerTypeSymbol)
ContainingType
).IsNullableEnabledForConstructorsAndInitializers(IsStatic);
Symbols\Source\SourceConstructorSymbolBase.cs (4)
65
ContainingType
.Name == ((ConstructorDeclarationSyntax)this.SyntaxNode).Identifier.ValueText)
73
if (this.IsVararg && (IsGenericMethod ||
ContainingType
.IsGenericType || _lazyParameters.Length > 0 && _lazyParameters[_lazyParameters.Length - 1].IsParams))
212
var containingType = (SourceNamedTypeSymbol)this.
ContainingType
;
241
if (
ContainingType
.IsWellKnownSetsRequiredMembersAttribute())
Symbols\Source\SourceDelegateMethodSymbol.cs (2)
355
: base((SourceNamedTypeSymbol)invoke.
ContainingType
, iAsyncResultType, syntax, MethodKind.Ordinary, RefKind.None, DeclarationModifiers.Virtual | DeclarationModifiers.Public)
393
: base((SourceNamedTypeSymbol)invoke.
ContainingType
, invoke.ReturnTypeWithAnnotations, syntax, MethodKind.Ordinary, invoke.RefKind, DeclarationModifiers.Virtual | DeclarationModifiers.Public)
Symbols\Source\SourceDestructorSymbol.cs (1)
172
return (object)this.
ContainingType
.BaseTypeNoUseSiteDiagnostics == null;
Symbols\Source\SourceMemberMethodSymbol.cs (5)
374
if (
ContainingType
.HasFileLocalTypes())
381
diagnostics.Add(ErrorCode.ERR_FileTypeDisallowedInSignature, GetFirstLocation(), returnType.Type,
ContainingType
);
388
diagnostics.Add(ErrorCode.ERR_FileTypeDisallowedInSignature, GetFirstLocation(), param.Type,
ContainingType
);
956
if (IsDeclaredReadOnly && !
ContainingType
.IsReadOnly)
1012
if (IsDeclaredReadOnly && !
ContainingType
.IsReadOnly)
Symbols\Source\SourceOrdinaryMethodOrUserDefinedOperatorSymbol.cs (2)
66
if (!
ContainingType
.IsPartial())
139
TypeSymbol.CheckModifierMismatchOnImplementingMember(this.
ContainingType
, this, overriddenOrExplicitlyImplementedMethod, isExplicit: true, diagnostics);
Symbols\Source\SourceOrdinaryMethodSymbol.cs (25)
142
(this.
ContainingType
.SpecialType == SpecialType.System_TypedReference || this.
ContainingType
.SpecialType == SpecialType.System_ArgIterator))
226
else if ((object)
ContainingType
.ContainingType != null)
228
diagnostics.Add(ErrorCode.ERR_ExtensionMethodsDecl, _location,
ContainingType
.Name);
230
else if (!
ContainingType
.IsScriptClass && !(
ContainingType
.IsStatic &&
ContainingType
.Arity == 0))
414
var sourceContainer = this.
ContainingType
as SourceMemberContainerTypeSymbol;
798
Debug.Assert(!IsStatic ||
ContainingType
.IsInterface || (!IsAbstract && !IsVirtual)); // Otherwise should have been reported and cleared earlier.
800
bool isExplicitInterfaceImplementationInInterface = isExplicitInterfaceImplementation &&
ContainingType
.IsInterface;
837
else if (IsSealed &&
ContainingType
.TypeKind == TypeKind.Struct)
845
diagnostics.Add(ErrorFacts.GetStaticClassReturnCode(
ContainingType
.IsInterfaceType()), location, ReturnType);
859
else if (IsAbstract &&
ContainingType
.TypeKind == TypeKind.Struct)
864
else if (IsVirtual &&
ContainingType
.TypeKind == TypeKind.Struct)
874
else if (IsAbstract && !
ContainingType
.IsAbstract && (
ContainingType
.TypeKind == TypeKind.Class ||
ContainingType
.TypeKind == TypeKind.Submission))
877
diagnostics.Add(ErrorCode.ERR_AbstractInConcreteClass, location, this,
ContainingType
);
879
else if (IsVirtual &&
ContainingType
.IsSealed)
882
diagnostics.Add(ErrorCode.ERR_NewVirtualInSealed, location, this,
ContainingType
);
892
else if (
ContainingType
.IsSealed && this.DeclaredAccessibility.HasProtected() && !this.IsOverride)
894
diagnostics.Add(AccessCheck.GetProtectedMemberInSealedTypeError(
ContainingType
), location, this);
896
else if (
ContainingType
.IsStatic && !IsStatic)
900
else if (isVararg && (IsGenericMethod ||
ContainingType
.IsGenericType || Parameters.Length > 0 && Parameters[Parameters.Length - 1].IsParams))
1140
var tpEnclosing =
ContainingType
.FindEnclosingTypeParameter(name);
Symbols\Source\SourcePropertyAccessorSymbol.cs (10)
481
return
ContainingType
.IsStructType() &&
529
if (IsAbstract && !
ContainingType
.IsAbstract && (
ContainingType
.TypeKind == TypeKind.Class ||
ContainingType
.TypeKind == TypeKind.Submission))
532
diagnostics.Add(ErrorCode.ERR_AbstractInConcreteClass, location, this,
ContainingType
);
534
else if (IsVirtual &&
ContainingType
.IsSealed &&
ContainingType
.TypeKind != TypeKind.Struct) // error CS0106 on struct already
537
diagnostics.Add(ErrorCode.ERR_NewVirtualInSealed, location, this,
ContainingType
);
543
else if (
ContainingType
.IsSealed && localAccessibility.HasProtected() && !this.IsOverride)
545
diagnostics.Add(AccessCheck.GetProtectedMemberInSealedTypeError(
ContainingType
), location, this);
Symbols\Source\SourceUserDefinedOperatorSymbolBase.cs (7)
55
if (this.
ContainingType
.IsInterface &&
64
if (this.
ContainingType
.IsStatic)
281
if (this.
ContainingType
.IsStatic)
476
if ((
ContainingType
.SpecialType == SpecialType.System_Nullable_T)
698
return type.Equals(this.
ContainingType
, ComparisonForUserDefinedOperators);
712
return IsSelfConstrainedTypeParameter(type, this.
ContainingType
);
755
diagnostics.Add(ErrorCode.ERR_BadAbstractEqualityOperatorSignature, this.GetFirstLocation(), this.
ContainingType
);
Symbols\Synthesized\Records\SynthesizedPrimaryConstructor.cs (1)
88
public new SourceMemberContainerTypeSymbol ContainingType => (SourceMemberContainerTypeSymbol)base.
ContainingType
;
Symbols\Synthesized\Records\SynthesizedRecordBaseEquals.cs (4)
32
TypeWithAnnotations.Create(
ContainingType
.BaseTypeNoUseSiteDiagnostics, NullableAnnotation.Annotated),
45
!overridden.ContainingType.Equals(
ContainingType
.BaseTypeNoUseSiteDiagnostics, TypeCompareKind.AllIgnoreOptions))
47
diagnostics.Add(ErrorCode.ERR_DoesNotOverrideBaseMethod, GetFirstLocation(), this,
ContainingType
.BaseTypeNoUseSiteDiagnostics);
67
ContainingType
.GetMembersUnordered().OfType<SynthesizedRecordObjEquals>().Single(),
Symbols\Synthesized\Records\SynthesizedRecordClone.cs (5)
98
return (ReturnType: !ContainingAssembly.RuntimeSupportsCovariantReturnsOfClasses && VirtualCloneInBase(
ContainingType
) is { } baseClone ?
100
TypeWithAnnotations.Create(isNullableEnabled: true,
ContainingType
),
110
var F = new SyntheticBoundNodeFactory(this,
ContainingType
.GetNonNullSyntaxNode(), compilationState, diagnostics);
120
var members =
ContainingType
.InstanceConstructors;
125
ctor.Parameters[0].Type.Equals(
ContainingType
, TypeCompareKind.AllIgnoreOptions))
Symbols\Synthesized\Records\SynthesizedRecordDeconstruct.cs (1)
51
var F = new SyntheticBoundNodeFactory(this,
ContainingType
.GetNonNullSyntaxNode(), compilationState, diagnostics);
Symbols\Synthesized\Records\SynthesizedRecordEqualityContractProperty.cs (1)
179
F.CloseMethod(F.Block(F.Return(F.Typeof(
ContainingType
, ReturnType))));
Symbols\Synthesized\Records\SynthesizedRecordEqualityOperator.cs (4)
34
var F = new SyntheticBoundNodeFactory(this,
ContainingType
.GetNonNullSyntaxNode(), compilationState, diagnostics);
43
foreach (var member in
ContainingType
.GetMembers(WellKnownMemberNames.ObjectEquals))
47
candidate.Parameters[0].Type.Equals(
ContainingType
, TypeCompareKind.AllIgnoreOptions))
65
if (
ContainingType
.IsRecordStruct)
Symbols\Synthesized\Records\SynthesizedRecordEqualityOperatorBase.cs (3)
68
var annotation =
ContainingType
.IsRecordStruct ? NullableAnnotation.Oblivious : NullableAnnotation.Annotated;
72
TypeWithAnnotations.Create(
ContainingType
, annotation),
75
TypeWithAnnotations.Create(
ContainingType
, annotation),
Symbols\Synthesized\Records\SynthesizedRecordEquals.cs (8)
36
var annotation =
ContainingType
.IsRecordStruct ? NullableAnnotation.Oblivious : NullableAnnotation.Annotated;
40
TypeWithAnnotations.Create(
ContainingType
, annotation),
48
var F = new SyntheticBoundNodeFactory(this,
ContainingType
.GetNonNullSyntaxNode(), compilationState, diagnostics);
58
bool isRecordStruct =
ContainingType
.IsRecordStruct;
67
else if (
ContainingType
.BaseTypeNoUseSiteDiagnostics.IsObjectType())
105
MethodSymbol? baseEquals =
ContainingType
.GetMembersUnordered().OfType<SynthesizedRecordBaseEquals>().Single().OverriddenMethod;
107
if (baseEquals is null || !baseEquals.ContainingType.Equals(
ContainingType
.BaseTypeNoUseSiteDiagnostics, TypeCompareKind.AllIgnoreOptions) ||
132
foreach (var f in
ContainingType
.GetFieldsToEmit())
Symbols\Synthesized\Records\SynthesizedRecordGetHashCode.cs (3)
50
if (
ContainingType
.IsRecordStruct)
54
else if (
ContainingType
.BaseTypeNoUseSiteDiagnostics.IsObjectType())
94
foreach (var f in
ContainingType
.GetFieldsToEmit())
Symbols\Synthesized\Records\SynthesizedRecordInequalityOperator.cs (2)
36
var F = new SyntheticBoundNodeFactory(this,
ContainingType
.GetNonNullSyntaxNode(), compilationState, diagnostics);
41
F.CloseMethod(F.Block(F.Return(F.Not(F.Call(receiver: null,
ContainingType
.GetMembers(WellKnownMemberNames.EqualityOperatorName).OfType<SynthesizedRecordEqualityOperator>().Single(),
Symbols\Synthesized\Records\SynthesizedRecordObjEquals.cs (5)
31
var annotation =
ContainingType
.IsRecordStruct ? NullableAnnotation.Oblivious : NullableAnnotation.Annotated;
57
if (
ContainingType
.IsRecordStruct)
62
F.Is(paramAccess,
ContainingType
),
63
F.Call(F.This(), _typedRecordEquals, F.Convert(
ContainingType
, paramAccess)));
69
expression = F.Call(F.This(), _typedRecordEquals, F.As(paramAccess,
ContainingType
));
Symbols\Synthesized\Records\SynthesizedRecordPrintMembers.cs (9)
93
var annotation =
ContainingType
.IsRecordStruct ? NullableAnnotation.Oblivious : NullableAnnotation.NotAnnotated;
110
!overridden.ContainingType.Equals(
ContainingType
.BaseTypeNoUseSiteDiagnostics, TypeCompareKind.AllIgnoreOptions))
112
diagnostics.Add(ErrorCode.ERR_DoesNotOverrideBaseMethod, GetFirstLocation(), this,
ContainingType
.BaseTypeNoUseSiteDiagnostics);
118
var F = new SyntheticBoundNodeFactory(this,
ContainingType
.GetNonNullSyntaxNode(), compilationState, diagnostics);
121
ImmutableArray<Symbol> printableMembers =
ContainingType
.GetMembers().WhereAsArray(m => isPrintable(m));
132
if (
ContainingType
.BaseTypeNoUseSiteDiagnostics.IsObjectType() ||
ContainingType
.IsRecordStruct)
142
if (!
ContainingType
.IsRecordStruct)
164
var basePrintCall = F.Call(receiver: F.Base(
ContainingType
.BaseTypeNoUseSiteDiagnostics), basePrintMethod, builder);
Symbols\Synthesized\Records\SynthesizedRecordToString.cs (3)
42
var annotation =
ContainingType
.IsRecordStruct ? NullableAnnotation.Oblivious : NullableAnnotation.NotAnnotated;
55
CSharpCompilation compilation =
ContainingType
.DeclaringCompilation;
66
block.Add(makeAppendString(F, builderLocal,
ContainingType
.Name));
Symbols\Synthesized\SynthesizedEventAccessorSymbol.cs (1)
92
if (!IsAbstract && !AssociatedEvent.IsWindowsRuntimeEvent && !
ContainingType
.IsStructType() &&
Symbols\Synthesized\SynthesizedSimpleProgramEntryPointSymbol.cs (1)
227
result = new InContainerBinder(
ContainingType
, result);