Base:
property
ContainingType
Microsoft.CodeAnalysis.CSharp.Symbol.ContainingType
124 references to ContainingType
Microsoft.CodeAnalysis.CSharp (124)
Lowering\ClosureConversion\ClosureConversion.cs (1)
1528translatedLambdaContainer = synthesizedMethod.ContainingType;
Lowering\ClosureConversion\SynthesizedClosureMethod.cs (1)
54var lambdaFrame = ContainingType as SynthesizedClosureEnvironment;
Symbols\Extensions\SynthesizedExtensionMarker.cs (3)
40var F = new SyntheticBoundNodeFactory(this, ContainingType.GetNonNullSyntaxNode(), compilationState, diagnostics); 80checkUnderspecifiedGenericExtension(parameter, ContainingType.TypeParameters, diagnostics); 108ContainingType.TypeParameters.Any(static (p, name) => p.Name == name, name))
Symbols\Source\SourceConstructorSymbol.cs (6)
186else if (ContainingType.IsSealed && this.DeclaredAccessibility.HasProtected() && !this.IsOverride) 188diagnostics.Add(AccessCheck.GetProtectedMemberInSealedTypeError(ContainingType), location, this); 190else if (ContainingType.IsStatic && methodKind == MethodKind.Constructor) 194else if (IsPartial && !ContainingType.IsPartial()) 221if (this.ContainingType is SourceMemberContainerTypeSymbol { AnyMemberHasAttributes: true }) 236: ((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)) 219var containingType = (SourceNamedTypeSymbol)this.ContainingType; 248if (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 (3)
381if (this.GetIsNewExtensionMember() && ContainingType.ExtensionParameter is { } extensionParameter) 395NamedTypeSymbol containingType = ContainingType; 984if (IsDeclaredReadOnly && !ContainingType.IsReadOnly)
Symbols\Source\SourceOrdinaryMethodOrUserDefinedOperatorSymbol.cs (2)
66if (!ContainingType.IsPartial()) 139TypeSymbol.CheckModifierMismatchOnImplementingMember(this.ContainingType, this, overriddenOrExplicitlyImplementedMethod, isExplicit: true, diagnostics);
Symbols\Source\SourceOrdinaryMethodSymbol.cs (26)
142(this.ContainingType.SpecialType == SpecialType.System_TypedReference || this.ContainingType.SpecialType == SpecialType.System_ArgIterator)) 227else if ((object)ContainingType.ContainingType != null) 229diagnostics.Add(ErrorCode.ERR_ExtensionMethodsDecl, _location, ContainingType.Name); 231else if (!ContainingType.IsScriptClass && !(ContainingType.IsStatic && ContainingType.Arity == 0)) 419var sourceContainer = this.ContainingType as SourceMemberContainerTypeSymbol; 824Debug.Assert(!IsStatic || ContainingType.IsInterface || (!IsAbstract && !IsVirtual)); // Otherwise should have been reported and cleared earlier. 826bool isExplicitInterfaceImplementationInInterface = isExplicitInterfaceImplementation && ContainingType.IsInterface; 863else if (IsSealed && ContainingType.TypeKind == TypeKind.Struct) 871diagnostics.Add(ErrorFacts.GetStaticClassReturnCode(ContainingType.IsInterfaceType()), location, ReturnType); 885else if (IsAbstract && ContainingType.TypeKind == TypeKind.Struct) 890else if (IsVirtual && ContainingType.TypeKind == TypeKind.Struct) 900else if (IsAbstract && !ContainingType.IsAbstract && (ContainingType.TypeKind == TypeKind.Class || ContainingType.TypeKind == TypeKind.Submission)) 903diagnostics.Add(ErrorCode.ERR_AbstractInConcreteClass, location, this, ContainingType); 905else if (IsVirtual && ContainingType.IsSealed) 908diagnostics.Add(ErrorCode.ERR_NewVirtualInSealed, location, this, ContainingType); 918else if (ContainingType.IsSealed && this.DeclaredAccessibility.HasProtected() && !this.IsOverride) 920diagnostics.Add(AccessCheck.GetProtectedMemberInSealedTypeError(ContainingType), location, this); 922else if (ContainingType is { IsExtension: true, ExtensionParameter.Name: "" } && !IsStatic) 926else if (ContainingType.IsStatic && !IsStatic) 930else if (isVararg && (IsGenericMethod || ContainingType.IsGenericType || Parameters.Length > 0 && Parameters[Parameters.Length - 1].IsParams)) 1159var tpEnclosing = ContainingType.FindEnclosingTypeParameter(name);
Symbols\Source\SourcePropertyAccessorSymbol.cs (11)
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); 557else if (ContainingType.IsExtension && IsInitOnly)
Symbols\Source\SourceUserDefinedOperatorSymbolBase.cs (13)
62if (this.ContainingType.IsInterface && 71if (this.ContainingType.IsStatic) 138else if (IsSealed && !IsOverride && !(IsExplicitInterfaceImplementation && ContainingType.IsInterface && IsAbstract)) 147else if (IsAbstract && !ContainingType.IsAbstract && !ContainingType.IsInterface) 150diagnostics.Add(ErrorCode.ERR_AbstractInConcreteClass, location, this, ContainingType); 152else if (IsVirtual && ContainingType.IsSealed) 155diagnostics.Add(ErrorCode.ERR_NewVirtualInSealed, location, this, ContainingType); 365if (this.ContainingType.IsStatic) 609if ((ContainingType.SpecialType == SpecialType.System_Nullable_T) 831return type.Equals(this.ContainingType, ComparisonForUserDefinedOperators); 845return IsSelfConstrainedTypeParameter(type, this.ContainingType); 888diagnostics.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)
172F.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)
69var annotation = ContainingType.IsRecordStruct ? NullableAnnotation.Oblivious : NullableAnnotation.Annotated; 73TypeWithAnnotations.Create(ContainingType, annotation), 76TypeWithAnnotations.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)
108if (!IsAbstract && !AssociatedEvent.IsWindowsRuntimeEvent && !ContainingType.IsStructType() &&
Symbols\Synthesized\SynthesizedSimpleProgramEntryPointSymbol.cs (1)
227result = new InContainerBinder(ContainingType, result);