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