24 overrides of ContainingType
Microsoft.CodeAnalysis.CSharp (24)
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.FieldSymbol.cs (1)
112public override NamedTypeSymbol ContainingType
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.PropertySymbol.cs (1)
173public override NamedTypeSymbol ContainingType
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.SynthesizedMethodBase.cs (1)
46public override NamedTypeSymbol ContainingType
Symbols\Metadata\PE\PEEventSymbol.cs (1)
228public override NamedTypeSymbol ContainingType
Symbols\Metadata\PE\PEFieldSymbol.cs (1)
192public override NamedTypeSymbol ContainingType
Symbols\Metadata\PE\PEMethodSymbol.cs (1)
466public override NamedTypeSymbol ContainingType => _containingType;
Symbols\Metadata\PE\PEPropertySymbol.cs (1)
429public override NamedTypeSymbol ContainingType
Symbols\NamedTypeSymbol.cs (1)
111public override NamedTypeSymbol ContainingType
Symbols\NamespaceSymbol.cs (1)
91public sealed override NamedTypeSymbol ContainingType
Symbols\Source\SourceEventSymbol.cs (1)
107public override NamedTypeSymbol ContainingType
Symbols\Source\SourceFieldSymbol.cs (1)
106public override NamedTypeSymbol ContainingType
Symbols\Source\SourceMemberMethodSymbol.cs (1)
528public override NamedTypeSymbol ContainingType
Symbols\Source\SourcePropertySymbolBase.cs (1)
536public override NamedTypeSymbol ContainingType
Symbols\SubstitutedFieldSymbol.cs (1)
46public override NamedTypeSymbol ContainingType
Symbols\SubstitutedMethodSymbol.cs (1)
203public override NamedTypeSymbol ContainingType
Symbols\SubstitutedPropertySymbol.cs (1)
48public override NamedTypeSymbol ContainingType
Symbols\Synthesized\Records\SynthesizedPrimaryConstructorParameterBackingFieldSymbol.cs (1)
70public override NamedTypeSymbol ContainingType
Symbols\Synthesized\SynthesizedBackingFieldSymbol.cs (1)
272public override NamedTypeSymbol ContainingType
Symbols\Synthesized\SynthesizedFieldSymbolBase.cs (1)
152public override NamedTypeSymbol ContainingType
Symbols\Synthesized\SynthesizedGlobalMethodSymbol.cs (1)
82public sealed override NamedTypeSymbol ContainingType
Symbols\Synthesized\SynthesizedImplementationMethod.cs (1)
120public sealed override NamedTypeSymbol ContainingType
Symbols\Synthesized\SynthesizedInstanceConstructor.cs (1)
60public sealed override NamedTypeSymbol ContainingType
Symbols\Synthesized\SynthesizedIntrinsicOperatorSymbol.cs (1)
323public override NamedTypeSymbol ContainingType
Symbols\Synthesized\SynthesizedStaticConstructor.cs (1)
30public override NamedTypeSymbol ContainingType
719 references to ContainingType
Microsoft.CodeAnalysis.CSharp (719)
Binder\Binder.cs (1)
469_ => member.ContainingType
Binder\Binder.ValueChecks.cs (21)
87return implementationMethod.AsMember(method.ContainingSymbol.ContainingType). 88ConstructIfGeneric(method.ContainingType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Concat(method.TypeArgumentsWithAnnotations)); 1155getItemOrSliceHelper = getItemOrSliceHelper.AsMember(getItemOrSliceHelper.ContainingType.Construct(ImmutableArray.Create(elementAccess.Expression.Type.TryGetInlineArrayElementField().TypeWithAnnotations))); 1446if (RequiresAssignableVariable(valueKind) && !backingField.ContainingType.IsReferenceType && (this.ContainingMemberOrLambda as MethodSymbol)?.IsEffectivelyReadOnly == true) 1695if (fieldSymbol.IsStatic || fieldSymbol.ContainingType.IsReferenceType) 1721? TypeSymbol.Equals(fieldSymbol.ContainingType, containing.ContainingType, TypeCompareKind.AllIgnoreOptions) 1723: TypeSymbol.Equals(fieldSymbol.ContainingType.OriginalDefinition, containing.ContainingType.OriginalDefinition, TypeCompareKind.AllIgnoreOptions))) 1778if (fieldSymbol.IsStatic || fieldSymbol.ContainingType.IsReferenceType) 1800if (fieldSymbol.IsStatic || fieldSymbol.ContainingType.IsReferenceType) 1825if (eventSymbol.IsStatic || eventSymbol.ContainingType.IsReferenceType) 2429var extensionParameter = symbol.ContainingType.ExtensionParameter; 2852return method.ContainingType.IsRefLikeType; 3379if (!_underlyingParameter.ContainingType.IsInterface || _type.IsReferenceType) 3411if (!_underlyingParameter.ContainingType.IsInterface || _type.IsReferenceType) 3787if (eventSymbol.IsStatic || eventSymbol.ContainingType.IsReferenceType) 4448if (fieldSymbol.IsStatic || !fieldSymbol.ContainingType.IsRefLikeType) 5164if (fieldSymbol.IsStatic || !fieldSymbol.ContainingType.IsRefLikeType) 5739this._symbol.ContainingType, 5779_symbol.ContainingType,
Binder\Binder_Await.cs (2)
161if (containingMemberOrLambda.ContainingType.IsScriptClass) 547@this.ReportDiagnosticsIfObsolete(diagnostics, method.ContainingType, syntax, hasBaseReceiver: false);
Binder\Binder_Conversions.cs (6)
1644ReportDiagnosticsIfObsolete(diagnostics, collectionBuilderMethod.ContainingType, syntax, hasBaseReceiver: false); 2133member.ContainingType, 2747Debug.Assert(analysis.Operator is { ParameterCount: 1 } and ({ MethodKind: MethodKind.Constructor } or { MethodKind: MethodKind.Ordinary, IsStatic: true, ContainingType.IsInterface: true })); 2749Debug.Assert(TypeSymbol.Equals(destination.StrippedType(), analysis.Operator.MethodKind == MethodKind.Constructor ? analysis.Operator.ContainingType : analysis.Operator.ReturnType, TypeCompareKind.AllIgnoreOptions)); 2769var instantiatedType = analysis.Operator.ContainingType; 3686return method.ContainingType.ExtensionParameter;
Binder\Binder_Expressions.cs (20)
63var containingType = memberOpt?.ContainingType; 1502field = backingField.AsMember(method.ContainingType); 1524var implicitReceiver = field.IsStatic ? null : ThisReference(node, field.ContainingType, wasCompilerGenerated: true); 2027var declaringType = members[0].ContainingType; 2384NamedTypeSymbol declaringType = member.ContainingType; 4931NamedTypeSymbol containingType = constructor.ContainingType; 5091NamedTypeSymbol baseType = constructor.ContainingType.BaseTypeNoUseSiteDiagnostics; 5219if (resultMember is null || resultMember.ContainingType.SpecialType != SpecialType.System_Object) 5266return constructor.ContainingType is SourceNamedTypeSymbol sourceType && 6301constructor.ContainingType.HasRequiredMembersError) // An error will be reported on the constructor if from source, or a use-site diagnostic will be reported on the use if from metadata. 6306return constructor.ContainingType.AllRequiredMembers; 6819this.IsSymbolAccessibleConditional(constructor, containingType, ref useSiteInfo, constructor.ContainingType); 8294Debug.Assert(propertySymbol.ContainingType.ExtensionParameter is not null); 8298receiver = CheckAndConvertExtensionReceiver(receiver, propertySymbol.ContainingType.ExtensionParameter, diagnostics); 9406Debug.Assert(lengthOrCountProperty.ContainingType.ExtensionParameter is not null); 9811NamedTypeSymbol type = fieldSymbol.ContainingType; 9939NamedTypeSymbol type = fieldSymbol.ContainingType; 10009if (symbol.ContainingType?.IsInterface == true) 11228receiver = CheckAndConvertExtensionReceiver(receiver, property.ContainingType.ExtensionParameter, diagnostics); 11576return new ErrorPropertySymbol(candidate.ContainingType, propertyType, candidate.Name, candidate.IsIndexer, candidate.IsIndexedProperty);
Binder\Binder_Initializers.cs (3)
147Debug.Assert((ContainingMemberOrLambda is TypeSymbol containing && TypeSymbol.Equals(containing, fieldSymbol.ContainingType, TypeCompareKind.ConsiderEverything2)) || //should be the binder for the type 148fieldSymbol.ContainingType.IsImplicitClass); //however, we also allow fields in namespaces to help support script scenarios 152binder = new WithPrimaryConstructorParametersBinder(fieldSymbol.ContainingType, binder);
Binder\Binder_Invocation.cs (7)
1115if (call.ReceiverOpt.Type.IsRestrictedType() && !call.Method.ContainingType.IsInterface && !TypeSymbol.Equals(call.Method.ContainingType, call.ReceiverOpt.Type, TypeCompareKind.ConsiderEverything2)) 1117SymbolDistinguisher distinguisher = new SymbolDistinguisher(compilation, call.ReceiverOpt.Type, call.Method.ContainingType); 1123SymbolDistinguisher distinguisher = new SymbolDistinguisher(compilation, this.ContainingType, call.Method.ContainingType); 1323receiver = CheckAndConvertExtensionReceiver(receiver, method.ContainingType.ExtensionParameter, diagnostics); 1941TypeSymbol.Equals(containingMethod.ContainingType, method.ContainingType, TypeCompareKind.ConsiderEverything) &&
Binder\Binder_Lookup.cs (5)
1131((options & LookupOptions.NamespacesOrTypesOnly) == 0 || !(current.IsSingleViable && TypeSymbol.Equals(current.SingleSymbolOrDefault.ContainingType, type, TypeCompareKind.AllIgnoreOptions)))) // The nested type will shadow everything from bases 1340var hiddenContainer = sym.ContainingType; 1346var hidingContainer = hidingSym.ContainingType; 1355if (!IsDerivedType(baseType: hiddenContainer, derivedType: hidingSym.ContainingType, basesBeingResolved, this.Compilation, useSiteInfo: ref useSiteInfo) && 1443symbol = symbol.ContainingType;
Binder\Binder_Operators.cs (14)
487Debug.Assert(method.ContainingType.ExtensionParameter is not null); 506leftConversion = CreateConversion(node, leftPlaceholder, conversion, isCast: false, conversionGroupOpt: null, InConversionGroupFlags.Unspecified, method.ContainingType.ExtensionParameter.Type, diagnostics); 1566Debug.Assert(!(signature.Method?.ContainingType?.IsInterface ?? false)); 1756NamedTypeSymbol t = (NamedTypeSymbol)signature.Method.ContainingType; 1767SourceUserDefinedOperatorSymbol.IsSelfConstrainedTypeParameter((definition = signature.Method.OriginalDefinition).ReturnType.StrippedType(), definition.ContainingType)); 1948NamedTypeSymbol extensionContainingType = signature.Method.OriginalDefinition.ContainingType.ContainingType; 2223if (operatorMethod.ContainingType.IsInterface && 3593Debug.Assert(method.ContainingType.ExtensionParameter is not null); 3612operandConversion = CreateConversion(node, operandPlaceholder, conversion, isCast: false, conversionGroupOpt: null, InConversionGroupFlags.Unspecified, method.ContainingType.ExtensionParameter.Type, diagnostics); 3923var extensionParameter = op.ContainingType.ExtensionParameter; 3967return typeComparer.Equals(x.ContainingType, y.ContainingType) && 3977int result = typeComparer.GetHashCode(method.ContainingType); 3996if (methodOpt?.ContainingType?.IsInterface == true && methodOpt.IsStatic)
Binder\Binder_Patterns.cs (6)
114else if (!match.ContainingType.AllInterfacesNoUseSiteDiagnostics.Contains(baseInterfaceForDefinition, Symbols.SymbolEqualityComparer.AllIgnoreOptions)) 130match = match.OriginalDefinition.AsMember(inputUnionType.TypeSubstitution.SubstituteNamedType(match.ContainingType)); 419NamedTypeSymbol originalContainingType = method.ContainingType.OriginalDefinition; 434membersInterfaceForDefinition.AsMember(unionType).Equals(method.ContainingType, TypeCompareKind.AllIgnoreOptions)) 442(unionType.IsDefinition ? container : unionType.TypeSubstitution.SubstituteNamedType(container)).Equals(method.ContainingType, TypeCompareKind.AllIgnoreOptions)) 485if (possiblyConstructedOrSubstitutedType.Equals(method.ContainingType, TypeCompareKind.AllIgnoreOptions))
Binder\Binder_Statements.cs (9)
1284((object)fixedPatternMethod == null || fixedPatternMethod.ContainingType.SpecialType != SpecialType.System_String)) 1795new CSDiagnosticInfo(ErrorCode.ERR_BadEventUsage, leastOverridden, leastOverridden.ContainingType) : 1816TypeSymbol.Equals(sourceProperty.ContainingType, fromMember.ContainingType, TypeCompareKind.AllIgnoreOptions) && 1823if (!propertySymbol.IsDefinition && propertySymbol.ContainingType.Equals(propertySymbol.ContainingType.OriginalDefinition, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)) 3917NamedTypeSymbol containingType = constructor.ContainingType; 4026NamedTypeSymbol baseType = constructor.ContainingType.BaseTypeNoUseSiteDiagnostics; 4055if (!AccessCheck.IsSymbolAccessible(baseConstructor, constructor.ContainingType, ref useSiteInfo)) 4066BoundExpression receiver = new BoundThisReference(syntax, constructor.ContainingType) { WasCompilerGenerated = true };
Binder\Binder_Symbols.cs (1)
1797symbol.MergeUseSiteInfo(ref info, symbol.ContainingType.GetUseSiteInfo());
Binder\Binder_Unsafe.cs (1)
61var typeArguments = methodSymbol.ContainingType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Concat(methodSymbol.TypeArgumentsWithAnnotations);
Binder\BinderFactory.BinderFactoryVisitor.cs (2)
1253nextBinder = new WithExtensionParameterBinder(method.ContainingType, nextBinder); 1299nextBinder = new WithExtensionParameterBinder(property.ContainingType, nextBinder);
Binder\DecisionDagBuilder.cs (2)
501var iTupleType = getLengthProperty.ContainingType; 534while (input.Source is BoundDagTypeEvaluation source && isDerivedType(source.Input.Type, symbol.ContainingType))
Binder\ForEachLoopBinder.cs (2)
252else if (getEnumeratorMethod.IsExtensionBlockMember() && getEnumeratorMethod.ContainingType.ExtensionParameter.RefKind == RefKind.Ref) 1047builder.CollectionType = builder.GetEnumeratorInfo.Method.ContainingType.ExtensionParameter.Type;
Binder\InMethodBinder.cs (2)
328typeParameters = _methodSymbol.ContainingType.TypeParameters.Concat(typeParameters); 330if (_methodSymbol.ContainingType.ExtensionParameter is { Name: not "" } receiver)
Binder\LockBinder.cs (1)
92!TypeSymbol.Equals(scopeType.ContainingType, lockType, TypeCompareKind.ConsiderEverything))
Binder\RefSafetyAnalysis.cs (3)
45var type = symbol.ContainingType; 707return method.ContainingType.ExtensionParameter; 1299resultType: node.EnumeratorInfoOpt.GetEnumeratorInfo.Method.ContainingType,
Binder\Semantics\AccessCheck.cs (2)
106symbol = symbol.ContainingType; 212return IsMemberAccessible(symbol.ContainingType, symbol.DeclaredAccessibility, within, throughTypeOpt, out failedThroughTypeCheck, compilation, ref useSiteInfo);
Binder\Semantics\Conversions\Conversions.cs (3)
360thisParameter = method.ContainingType.ExtensionParameter; 374else if (method.ContainingType.IsNullableType() && !method.IsOverride) 498if (method.ContainingType.IsNullableType() && !method.IsOverride)
Binder\Semantics\Operators\BinaryOperatorOverloadResolution.cs (10)
847equalsIgnoringNullableAndDynamic(op.Signature.Method.ContainingType, existingSignature.Method.ContainingType)) 1505Debug.Assert(extensionCandidatesInSingleScope.All(static m => m.ContainingType.ExtensionParameter is not null)); 1518NamedTypeSymbol extension = method.ContainingType; 1588Debug.Assert(candidate.Method.ContainingType.ExtensionParameter is not null); 1606var extensionParameter = method.ContainingType.ExtensionParameter; 1615Debug.Assert(candidate.Method.ContainingType.ExtensionParameter is not null); 1619if (!candidate.Method.ContainingType.ExtensionParameter.Type.IsValidNullableTypeArgument() || 1620!Conversions.ConvertExtensionMethodThisArg(MakeNullable(candidate.Method.ContainingType.ExtensionParameter.Type), operand.Type, ref useSiteInfo, isMethodGroupConversion: false).Exists) 1625else if (!Conversions.ConvertExtensionMethodThisArg(candidate.Method.ContainingType.ExtensionParameter.Type, operand.Type, ref useSiteInfo, isMethodGroupConversion: false).Exists)
Binder\Semantics\Operators\UnaryOperatorOverloadResolution.cs (12)
146Debug.Assert(extensionCandidatesInSingleScope.All(static m => m.ContainingType.ExtensionParameter is not null)); 159NamedTypeSymbol extension = method.ContainingType; 221Debug.Assert(candidate.Method.ContainingType.ExtensionParameter is not null); 227if (!candidate.Method.ContainingType.ExtensionParameter.Type.IsValidNullableTypeArgument() || 228!Conversions.ConvertExtensionMethodThisArg(MakeNullable(candidate.Method.ContainingType.ExtensionParameter.Type), operand.Type, ref useSiteInfo, isMethodGroupConversion: false).Exists) 233else if (!Conversions.ConvertExtensionMethodThisArg(candidate.Method.ContainingType.ExtensionParameter.Type, operand.Type, ref useSiteInfo, isMethodGroupConversion: false).Exists) 253if (x.OriginalDefinition.ContainingType.ContainingType != (object)x.OriginalDefinition.ContainingType.ContainingType) 258var xExtension = x.OriginalDefinition.ContainingType; 261var yExtension = y.OriginalDefinition.ContainingType; 288int result = typeComparer.GetHashCode(op.OriginalDefinition.ContainingType.ContainingType); 290var extension = op.OriginalDefinition.ContainingType;
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (1)
3282constructedFromMethod.ContainingType,
Binder\Semantics\OverloadResolution\OverloadResolution.cs (26)
817else if (member.IsExtensionBlockMember() && member.ContainingType is { } extension && ConstraintsHelper.RequiresChecking(extension)) 908NamedTypeSymbol containingType = member.ContainingType; 1129NamedTypeSymbol memberContainingType = member.ContainingType; 1395checkOverrideContainingType && !moreDerivedOverride.ContainingType.IsDerivedFrom(member.ContainingType, TypeCompareKind.ConsiderEverything, ref useSiteInfo) || 1429if (!member.ContainingType.IsClassType()) 1448NamedTypeSymbol memberContainingType = member.ContainingType; 1451NamedTypeSymbol otherContainingType = otherMember.ContainingType; 1488|| (result.Member.IsExtensionBlockMember() && !typeArgumentsAccessible(result.Member.ContainingType.GetMemberTypeArgumentsNoUseSiteDiagnostics(), ref useSiteInfo))) 1620if (IsLessDerivedThanAny(index: f, result.LeastOverriddenMember.ContainingType, results, ref useSiteInfo)) 1645var currentType = result.LeastOverriddenMember.ContainingType; 1714var type = result.LeastOverriddenMember.ContainingType; 1736if (member.ContainingType.IsInterfaceType()) 1903? memberWithPriority.ContainingType.ContainingType 1904: memberWithPriority.ContainingType; 2505if (m1.Member.ContainingType.TypeKind == TypeKind.Submission && m2.Member.ContainingType.TypeKind == TypeKind.Submission) 2605ParameterSymbol? extensionParameter = member.ContainingType.ExtensionParameter; 3915Debug.Assert(member.ContainingType.ExtensionParameter is not null); 3916hasSomeRefKinds |= member.ContainingType.ExtensionParameter.RefKind != RefKind.None; 4400? method.ContainingType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Concat(method.TypeArgumentsWithAnnotations) 4406var result = property.ContainingType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics; 4438member.ContainingType, 4457if (member.ContainingType.Arity > 0) 4459var extensionTypeArguments = MethodTypeInferrer.InferTypeArgumentsFromReceiverType(member.ContainingType, args[0], _binder.Compilation, _binder.Conversions, ref useSiteInfo); 4780return container.IsExtensionBlockMember() && parameterType.ContainsTypeParameter(typeParameterContainer: container.ContainingType);
Binder\Semantics\OverloadResolution\OverloadResolution_ArgsToParameters.cs (1)
62return [symbol.ContainingType.ExtensionParameter.TypeWithAnnotations, .. symbol.GetParameterTypes()];
BoundTree\BoundAwaitableInfo.cs (1)
15Debug.Assert(RuntimeAsyncAwaitCall.Method.ContainingType.ExtendedSpecialType == InternalSpecialType.System_Runtime_CompilerServices_AsyncHelpers);
BoundTree\Constructors.cs (3)
62!fieldSymbol.ContainingType.IsValueType || 261: this(syntax, constructor, ImmutableArray.Create<BoundExpression>(arguments), default(ImmutableArray<string?>), default(ImmutableArray<RefKind>), false, default(ImmutableArray<int>), default(BitVector), null, null, constructor.ContainingType) 265: this(syntax, constructor, arguments, default(ImmutableArray<string?>), default(ImmutableArray<RefKind>), false, default(ImmutableArray<int>), default(BitVector), null, null, constructor.ContainingType)
CodeGen\CodeGenerator_HasHome.cs (1)
245if (!TypeSymbol.Equals(field.ContainingType, containingSymbol.ContainingSymbol as NamedTypeSymbol, TypeCompareKind.AllIgnoreOptions))
CodeGen\EmitConversion.cs (2)
385if (!method.IsStatic && method.IsMetadataVirtual(this._module.SourceModule) && !method.ContainingType.IsDelegateType() && !receiver.SuppressVirtualCalls) 392method = method.GetConstructedLeastOverriddenMethod(_method.ContainingType, requireSameReturnType: true);
CodeGen\EmitExpression.cs (13)
179var thisType = _method.ContainingType; 1150Debug.Assert(!field.IsConst || field.ContainingType.SpecialType == SpecialType.System_Decimal, 1656Debug.Assert(TypeSymbol.Equals(method.ContainingType, receiver.Type, TypeCompareKind.ConsiderEverything2)); 1661EmitSymbolToken(method.ContainingType, call.Syntax); 1879NamedTypeSymbol methodContainingType = method.ContainingType; 1984actualMethodTargetedByTheCall = method.GetConstructedLeastOverriddenMethod(_method.ContainingType, requireSameReturnType: true); 1987if (callKind == CallKind.ConstrainedCallVirt && actualMethodTargetedByTheCall.ContainingType.IsValueType) 2004if (IsThisReceiver(receiver) && actualMethodTargetedByTheCall.ContainingType.IsSealed && 2337Debug.Assert(method.ContainingType.IsVerifierValue(), "this is not a value type"); 2350var containingType = method.ContainingType; 2532if (originalDef.ContainingType.Name == NamedTypeSymbol.ValueTupleTypeName && 3737EmitSymbolToken(node.Method.ContainingType, node.Syntax); 3764EmitSymbolToken(node.Field.ContainingType, node.Syntax);
CodeGen\EmitStackAllocInitializer.cs (1)
74var readOnlySpan = spanGetItemDefinition.ContainingType.Construct(elementType);
Compilation\CSharpCompilation.cs (2)
2088if (candidate.IsGenericMethod || candidate.ContainingType.IsGenericType) 3191return IsDefinedOrImplementedInSourceTree(symbol.ContainingType, tree, span);
Compilation\InitializerSemanticModel.cs (2)
279Debug.Assert(MemberSymbol.ContainingType is SourceMemberContainerTypeSymbol); 280return MemberSymbol.ContainingType is SourceMemberContainerTypeSymbol type &&
Compilation\SyntaxTreeSemanticModel.cs (1)
1279outer = outer.GetFieldInitializerBinder(symbol, suppressBinderFlagsFieldInitializer: !this.IsRegularCSharp && symbol.ContainingType.IsScriptClass);
Compiler\ClsComplianceChecker.cs (10)
330CheckParameterCompliance(symbol.Parameters, symbol.ContainingType); 331CheckTypeParameterCompliance(symbol.TypeParameters, symbol.ContainingType); 375CheckParameterCompliance(symbol.Parameters, symbol.ContainingType); 501NamedTypeSymbol containingType = symbol.ContainingType; 545NamedTypeSymbol containingType = symbol.ContainingType; 738System.Diagnostics.Debug.Assert(method.ContainingType.TypeKind == TypeKind.Delegate); 739symbol = method.ContainingType; // Refer to the delegate type in diagnostics. 760if (!IsCompliantType(type, symbol.ContainingType)) 1174Symbol containing = (Symbol)symbol.ContainingType ?? symbol.ContainingAssembly; 1228symbol = symbol.ContainingType;
Compiler\DocumentationCommentCompiler.cs (3)
426var symbolForDocComments = symbol is SynthesizedRecordPropertySymbol ? symbol.ContainingType : symbol; 810symbol = symbol.ContainingType; 1242diagnostics.AddDependencies(symbol as TypeSymbol ?? symbol.ContainingType);
Compiler\MethodBodySynthesizer.cs (6)
37Debug.Assert((object)constructor.ContainingType.BaseTypeNoUseSiteDiagnostics == null || constructor.ContainingType.BaseTypeNoUseSiteDiagnostics.SpecialType == SpecialType.System_Object); 40BoundExpression receiver = new BoundThisReference(syntax, constructor.ContainingType) { WasCompilerGenerated = true }; 96var thisReference = new BoundThisReference(syntax, submissionConstructor.ContainingType) { WasCompilerGenerated = true }; 550method.ContainingType) 597NamedTypeSymbol baseType = method.ContainingType.BaseTypeNoUseSiteDiagnostics;
Compiler\MethodBodySynthesizer.Lowered.cs (3)
384NamedTypeSymbol equalityComparerType = system_Collections_Generic_EqualityComparer_T__GetHashCode.ContainingType; 418NamedTypeSymbol equalityComparerType = equalityComparer_Equals.ContainingType; 465BoundExpression invocation = F.Call(methodToInvoke.IsStatic ? null : (useBaseReference ? (BoundExpression)F.Base(baseType: methodToInvoke.ContainingType) : F.This()),
Compiler\MethodCompiler.cs (13)
248synthesizedEntryPoint = new SynthesizedEntryPointSymbol.AsyncForwardEntryPoint(compilation, entryPoint.ContainingType, entryPoint); 252moduleBeingBuilt.AddSynthesizedDefinition(entryPoint.ContainingType, synthesizedEntryPoint.GetCciAdapter()); 283new TypeCompilationState(synthesizedEntryPoint.ContainingType, compilation, moduleBeingBuilt), 873if (!interfaces.Contains(synthesizedExplicitImpl.ExplicitInterfaceImplementations[0].ContainingType, 947if (methodSymbol.IsAbstract || methodSymbol.ContainingType?.IsDelegateType() == true) 1073Debug.Assert(!prependedDefaultValueTypeConstructorInitializer || methodSymbol.ContainingType.IsStructType()); 1087((methodSymbol.ContainingType.IsStructType() && !methodSymbol.IsImplicitConstructor) || 1516method.ContainingType, 1559method.ContainingType, 1577method.ContainingType, 2497Debug.Assert(!method.ContainingType.IsDelegateType()); 2522if (ctorCall != null && !ctorCall.HasAnyErrors && ctorCall.Method != method && TypeSymbol.Equals(ctorCall.Method.ContainingType, method.ContainingType, TypeCompareKind.ConsiderEverything2))
Compiler\SynthesizedMetadataCompiler.cs (1)
80if (!interfaces.Contains(synthesizedExplicitImpl.ExplicitInterfaceImplementations[0].ContainingType,
DocumentationComments\DocumentationCommentIDVisitor.PartVisitor.cs (5)
67Visit(symbol.ContainingType, builder); 100Visit(symbol.ContainingType, builder); 126Visit(symbol.ContainingType, builder); 140Visit(symbol.ContainingType, builder); 163for (NamedTypeSymbol curr = containingSymbol.ContainingType; (object)curr != null; curr = curr.ContainingType)
Emitter\EditAndContinue\CSharpSymbolMatcher.cs (1)
548var otherType = (NamedTypeSymbol?)Visit(member.ContainingType);
Emitter\Model\EventSymbolAdapter.cs (2)
109return AdaptedEventSymbol.ContainingType.GetCciAdapter(); 129return AdaptedEventSymbol.ContainingType.GetCciAdapter();
Emitter\Model\FieldSymbolAdapter.cs (2)
97return moduleBeingBuilt.Translate(AdaptedFieldSymbol.ContainingType, 276return AdaptedFieldSymbol.ContainingType.GetCciAdapter();
Emitter\Model\MethodSymbolAdapter.cs (14)
58(!AdaptedMethodSymbol.IsGenericMethod || PEModuleBuilder.IsGenericType(AdaptedMethodSymbol.ContainingType))) 60Debug.Assert((object)AdaptedMethodSymbol.ContainingType != null && 61PEModuleBuilder.IsGenericType(AdaptedMethodSymbol.ContainingType)); 84NamedTypeSymbol containingType = AdaptedMethodSymbol.ContainingType; 276NamedTypeSymbol container = AdaptedMethodSymbol.ContainingType; 315return ((SourceMemberContainerTypeSymbol)AdaptedMethodSymbol.ContainingType.ContainingType).GetExtensionGroupingInfo().GetCorrespondingMarkerType(marker); 319var containingType = AdaptedMethodSymbol.ContainingType; 323return AdaptedMethodSymbol.ContainingType.GetCciAdapter(); 418return !AdaptedMethodSymbol.ContainingType.IsExtension && AdaptedMethodSymbol.IsExternal; 445return !AdaptedMethodSymbol.ContainingType.IsExtension && AdaptedMethodSymbol.GetDllImportData() != null; 454return AdaptedMethodSymbol.ContainingType.IsExtension ? null : AdaptedMethodSymbol.GetDllImportData(); 461return AdaptedMethodSymbol.ContainingType.IsExtension ? default : AdaptedMethodSymbol.ImplementationAttributes; 635return this.IsExtern || (object)ContainingType != null && ContainingType.TypeKind == TypeKind.Delegate;
Emitter\Model\NamedTypeSymbolAdapter.cs (2)
392Debug.Assert(body.ContainingType == (object)container); 395if (!interfaces.Contains(implemented.ContainingType, SymbolEqualityComparer.ConsiderEverything))
Emitter\Model\PEModuleBuilder.cs (4)
1336else if (!needDeclaration && IsGenericType(fieldSymbol.ContainingType)) 1402NamedTypeSymbol container = methodSymbol.ContainingType; 1476NamedTypeSymbol container = methodSymbol.ContainingType; 1584IsGenericType(container.ContainingType);
Emitter\Model\PropertySymbolAdapter.cs (4)
226var containingType = AdaptedPropertySymbol.ContainingType; 230return AdaptedPropertySymbol.ContainingType.GetCciAdapter(); 253var containingType = AdaptedPropertySymbol.ContainingType; 257return AdaptedPropertySymbol.ContainingType.GetCciAdapter();
Emitter\Model\SpecializedGenericMethodInstanceReference.cs (2)
27Debug.Assert(PEModuleBuilder.IsGenericType(underlyingMethod.ContainingType) && underlyingMethod.ContainingType.IsDefinition);
Emitter\Model\TypeMemberReference.cs (1)
21return moduleBeingBuilt.Translate(UnderlyingSymbol.ContainingType, (CSharpSyntaxNode)context.SyntaxNode, context.Diagnostics);
Emitter\NoPia\EmbeddedTypesManager.cs (3)
506var containerKind = field.AdaptedFieldSymbol.ContainingType.TypeKind; 513ReportNotEmbeddableSymbol(ErrorCode.ERR_InteropStructContainsMethods, field.AdaptedFieldSymbol.ContainingType, syntaxNodeOpt, diagnostics, this); 667NamedTypeSymbol namedType = member.AdaptedSymbol.ContainingType;
FlowAnalysis\AbstractFlowPass.cs (1)
2244fieldSymbol.ContainingType.TypeKind == TypeKind.Struct &&
FlowAnalysis\DefiniteAssignment.cs (5)
103&& CurrentSymbol is MethodSymbol { MethodKind: MethodKind.Constructor, ContainingType.TypeKind: TypeKind.Struct }; 1211Debug.Assert(CurrentSymbol is MethodSymbol { MethodKind: MethodKind.Constructor, ContainingType.TypeKind: TypeKind.Struct }); 1215NamedTypeSymbol containingType = thisParameter.ContainingType; 1264if (CurrentSymbol is not MethodSymbol { MethodKind: MethodKind.Constructor, ContainingType.TypeKind: TypeKind.Struct }) 1445if (fieldSymbol.ContainingType.IsReferenceType || fieldSymbol.IsStatic) return null;
FlowAnalysis\FlowAnalysisPass.cs (1)
117NamedTypeSymbol containingType = method.ContainingType;
FlowAnalysis\LocalDataFlowPass.cs (2)
165TypeSymbol containingType = symbol.ContainingType; 172while (!TypeSymbol.Equals(containingType, symbol.ContainingType, TypeCompareKind.ConsiderEverything))
FlowAnalysis\NullableWalker.cs (48)
704? method.ContainingType.GetMembersUnordered().SelectManyAsArray( 714foreach (var member in method.ContainingType.GetMembersUnordered()) 729if (chainedConstructorEnforcesRequiredMembers && !constructorEnforcesRequiredMembers && method.ContainingType.BaseTypeNoUseSiteDiagnostics is { } baseType) 950&& (!method.ContainingType.IsValueType 954return membersToBeInitialized(method.ContainingType, includeAllMembers: true, includeCurrentTypeRequiredMembers, includeBaseRequiredMembers); 959return membersToBeInitialized(method.ContainingType, includeAllMembers: method.IncludeFieldInitializersInBody(), includeCurrentTypeRequiredMembers, includeBaseRequiredMembers); 1055foreach (var member in property.ContainingType.GetMembers(notNullMemberName)) 1098foreach (var member in method.ContainingType.GetMembers(memberName)) 1134enforceMemberNotNullWhenIfAffected(returnStatement.Syntax, sense: true, members: method.ContainingType.GetMembers(memberName), state: pendingReturn.StateWhenTrue, otherState: pendingReturn.StateWhenFalse); 1139enforceMemberNotNullWhenIfAffected(returnStatement.Syntax, sense: false, members: method.ContainingType.GetMembers(memberName), state: pendingReturn.StateWhenFalse, otherState: pendingReturn.StateWhenTrue); 1165foreach (var member in method.ContainingType.GetMembers(memberName)) 1218var type = method.ContainingType; 1537&& method.ContainingType is SourceMemberContainerTypeSymbol containingType) 2312if ((constructor.IsStatic && containingSlot == 0 && constructor.ContainingType.Equals(symbol.ContainingType)) 2772TypeSymbol? possibleBase = possibleMember.ContainingType; 3856(FieldSymbol { ContainingType: { IsTupleType: true }, TupleElementIndex: var oi } originalField, FieldSymbol { ContainingType: { IsTupleType: true }, TupleElementIndex: var ui } updatedField) => 4419var containingType = constructor?.ContainingType; 4473constructor.ContainingType.Equals(type, TypeCompareKind.AllIgnoreOptions) && 5705TypeSymbol methodContainer = method.ContainingType; 5714else if (method.ContainingType.Arity != 0) 5716NamedTypeSymbol extension = method.OriginalDefinition.ContainingType; 6078var containingType = this._symbol?.ContainingType; 6850Debug.Assert(node.Method.ContainingType.ExtensionParameter is not null); 6851annotations = node.Method.ContainingType.ExtensionParameter.FlowAnalysisAnnotations; 7033ParameterSymbol? extensionParameter = member.ContainingType.ExtensionParameter; 7067ParameterSymbol? extensionParameter = member.ContainingType.ExtensionParameter; 7176var wellKnownType = wellKnownMethod.ContainingType; 7197if (implementationMethod.ContainingType.IsInterface) 7228while (!baseType.Equals(implementationMethod.ContainingType) && method is object) 7230if (baseType.Equals(method.ContainingType)) 7244if (method is object && baseType.Equals(method.ContainingType)) 7369method.ContainingType.IsReferenceType) 7674if (member.ContainingType is { } extension && ConstraintsHelper.RequiresChecking(extension)) 8001var type = method.ContainingType; 8756definition.ContainingType, 9184var symbolContainer = symbol.ContainingType; 9196Debug.Assert(symbol.ContainingType.IsDefinition); 10387var extensionBlockFormOffset = parameterOpt?.ContainingType.IsExtension is true ? 1 : 0; 10630Debug.Assert(analysis.Operator is { ParameterCount: 1 } and ({ MethodKind: MethodKind.Constructor } or { MethodKind: MethodKind.Ordinary, IsStatic: true, ContainingType.IsInterface: true })); 10632Debug.Assert(TypeSymbol.Equals(targetTypeWithNullability.Type.StrippedType(), analysis.Operator.MethodKind == MethodKind.Constructor ? analysis.Operator.ContainingType : analysis.Operator.ReturnType, TypeCompareKind.AllIgnoreOptions)); 10714Debug.Assert(factory is { IsStatic: true, ContainingType.IsInterface: true }); 11132ParameterSymbol? receiverParameter = isExtensionBlockMethod ? method.ContainingType.ExtensionParameter : method.Parameters[0]; 11518var receiverParameter = isExtensionBlockMethod ? deconstructMethod.ContainingType.ExtensionParameter : deconstructMethod.Parameters[0]; 12384if ((object)getMethod != null && getMethod.ContainingType.SpecialType == SpecialType.System_Nullable_T) 12880else if (method.ContainingType.Arity != 0) 12882NamedTypeSymbol extension = method.OriginalDefinition.ContainingType;
FlowAnalysis\ReadWriteWalker.cs (1)
178if (expr.FieldSymbol.ContainingType.IsReferenceType) return;
Lowering\AsyncRewriter\AsyncExceptionHandlerRewriter.cs (2)
41Debug.Assert(TypeSymbol.Equals(factory.CurrentType, (containingType ?? containingMethod.ContainingType), TypeCompareKind.ConsiderEverything2)); 502exceptionDispatchInfoCapture.ContainingType,
Lowering\AsyncRewriter\AsyncMethodToStateMachineRewriter.cs (1)
432? F.StaticCall(methodSymbol.ContainingType, methodSymbol, receiver)
Lowering\AsyncRewriter\RuntimeAsyncRewriter.cs (1)
149runtimeAsyncAwaitMethod.ContainingType.OriginalDefinition,
Lowering\BoundTreeToDifferentEnclosingContextRewriter.cs (9)
198if (property.ContainingType.IsAnonymousType) 204var newType = (NamedTypeSymbol)TypeMap.SubstituteType(property.ContainingType).AsTypeSymbolOnly(); 205if (ReferenceEquals(newType, property.ContainingType)) 224.AsMember((NamedTypeSymbol)TypeMap.SubstituteType(property.ContainingType).AsTypeSymbolOnly()) 238.AsMember((NamedTypeSymbol)TypeMap.SubstituteType(field.ContainingType).AsTypeSymbolOnly()); 256if (method.ContainingType.IsAnonymousType) 259var newType = (NamedTypeSymbol)TypeMap.SubstituteType(method.ContainingType).AsTypeSymbolOnly(); 260if (ReferenceEquals(newType, method.ContainingType)) 281.AsMember((NamedTypeSymbol)TypeMap.SubstituteType(method.ContainingType).AsTypeSymbolOnly())
Lowering\ClosureConversion\ClosureConversion.cs (10)
340get { return _topLevelMethod.ContainingType; } 445translatedLambdaContainer = _topLevelMethod.ContainingType; 467translatedLambdaContainer = _topLevelMethod.ContainingType; 472Debug.Assert((object)translatedLambdaContainer != _topLevelMethod.ContainingType || 692Debug.Assert(TypeSymbol.Equals(frameType, constructor.ContainingType, TypeCompareKind.ConsiderEverything2)); 864return (!_currentMethod.IsStatic && TypeSymbol.Equals(_currentMethod.ContainingType, _topLevelMethod.ContainingType, TypeCompareKind.ConsiderEverything2)) 866: FramePointer(node.Syntax, _topLevelMethod.ContainingType); // technically, not the correct static type 1034var translatedLambdaContainer = synthesizedMethod.ContainingType; 1076receiver = new BoundTypeExpression(syntax, null, synthesizedMethod.ContainingType);
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (1)
787unquoted = _bound.Call(_bound.MethodInfo(method, createDelegate.ContainingType), createDelegate, _bound.Typeof(delegateType, createDelegate.Parameters[0].Type), receiver);
Lowering\DiagnosticsPass_ExpressionTrees.cs (2)
278Binder.ReportDiagnosticsIfObsolete(_diagnostics, node.EventSymbol.AssociatedField, node.Syntax, hasBaseReceiver, _containingSymbol, _containingSymbol.ContainingType, BinderFlags.None); 293Binder.ReportDiagnosticsIfObsolete(_diagnostics, node.Event, ((AssignmentExpressionSyntax)node.Syntax).Left, hasBaseReceiver, _containingSymbol, _containingSymbol.ContainingType, BinderFlags.None);
Lowering\DiagnosticsPass_Warnings.cs (4)
116TypeSymbol baseType = fieldAccess.FieldSymbol.ContainingType; 154if ((object)interlocked != null && TypeSymbol.Equals(interlocked, method.ContainingType, TypeCompareKind.ConsiderEverything2)) 238(object)method.ContainingType == null || 239!method.ContainingType.IsComImport)
Lowering\ExtensionMethodReferenceRewriter.cs (2)
158method = implementationMethod.AsMember(method.ContainingSymbol.ContainingType). 159ConstructIfGeneric(method.ContainingType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Concat(method.TypeArgumentsWithAnnotations));
Lowering\InitializerRewriter.cs (1)
95new BoundThisReference(syntax, field.ContainingType);
Lowering\Instrumentation\CodeCoverageInstrumenter.cs (1)
145var containingType = method.ContainingType;
Lowering\Instrumentation\LocalStateTracingInstrumenter.cs (1)
176if (IsSameOrNestedType(method.ContainingType, contextType))
Lowering\Instrumentation\ModuleCancellationInstrumenter.cs (4)
132lastArgumentType.Equals(_throwMethod.ContainingType, TypeCompareKind.ConsiderEverything)) 166foreach (var member in methodDefinition.ContainingType.GetMembers(method.Name)) 190lastParamType.Equals(_throwMethod.ContainingType, TypeCompareKind.ConsiderEverything) && 216var result = overload.AsMember(method.ContainingType);
Lowering\IteratorRewriter\IteratorFinallyMethodSymbol.cs (1)
206get { return ContainingType.Locations; }
Lowering\LocalRewriter\DelegateCacheContainer.cs (1)
35(owner.ContainingType is { IsExtension: true } extensionType ? extensionType.TypeParameters : []).Concat(
Lowering\LocalRewriter\LocalRewriter.cs (3)
73Debug.Assert(TypeSymbol.Equals(factory.CurrentType, (containingType ?? containingMethod.ContainingType), TypeCompareKind.ConsiderEverything2)); 932if (!lhsField.IsStatic && lhsField.ContainingType.IsStructType()) 1156ParameterSymbol? extensionParameter = member.ContainingType.ExtensionParameter;
Lowering\LocalRewriter\LocalRewriter.DecisionDagRewriter.cs (1)
175!method.ContainingType.SpecialType.IsPrimitiveRecursiveStruct();
Lowering\LocalRewriter\LocalRewriter.PatternLocalRewriter.cs (1)
176receiver = _factory.Type(method.ContainingType);
Lowering\LocalRewriter\LocalRewriter_Call.cs (11)
48NamedTypeSymbol firstContainer = node.ApplicableMethods.First().ContainingType; 49Debug.Assert(node.ApplicableMethods.All(m => !m.RequiresInstanceReceiver && TypeSymbol.Equals(m.ContainingType, firstContainer, TypeCompareKind.ConsiderEverything2))); 165Debug.Assert(!interceptor.ContainingType.IsGenericType); 170method.ContainingType.GetAllTypeArgumentsNoUseSiteDiagnostics(typeArgumentsBuilder); 204var isAccessible = AccessCheck.IsSymbolAccessible(interceptor, containingMethod.ContainingType, ref useSiteInfo); 468method.ContainingType.IsObjectType() && 954Debug.Assert(methodOrIndexer.ContainingType.ExtensionParameter is { }); 956RefKind receiverRefKind = methodOrIndexer.ContainingType.ExtensionParameter.RefKind; 1334Debug.Assert(methodOrIndexer.ContainingType.ExtensionParameter is not null); 1335return methodOrIndexer.ContainingType.ExtensionParameter.Type as NamedTypeSymbol; 1338return (NamedTypeSymbol?)methodOrIndexer.ContainingType;
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (1)
993var spanOfElementType = spanCtorArray.ContainingType.Construct(arrayType.ElementType);
Lowering\LocalRewriter\LocalRewriter_CompoundAssignmentOperator.cs (4)
259return symbol.IsExtensionBlockMember() && !symbol.IsStatic && symbol.ContainingType.ExtensionParameter is { RefKind: RefKind.None, Type.IsReferenceType: false }; 515if (indexer.ContainingType.IsComImport) 619var memberContainingType = fieldOrEvent.ContainingType; 1053if (method.ContainingType?.IsNullableType() == true)
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (6)
576var receiver = (!method.RequiresInstanceReceiver && !oldNodeOpt.IsExtensionMethod && !method.IsAbstract && !method.IsVirtual) ? _factory.Type(method.ContainingType) : mg.ReceiverOpt; 962Debug.Assert(analysis.Operator is { ParameterCount: 1 } and ({ MethodKind: MethodKind.Constructor } or { MethodKind: MethodKind.Ordinary, IsStatic: true, ContainingType.IsInterface: true })); 964Debug.Assert(TypeSymbol.Equals(rewrittenType.StrippedType(), analysis.Operator.MethodKind == MethodKind.Constructor ? analysis.Operator.ContainingType : analysis.Operator.ReturnType, TypeCompareKind.AllIgnoreOptions)); 1560Debug.Assert(conversion.Method is { ParameterCount: 1 } and ({ MethodKind: MethodKind.Constructor } or { MethodKind: MethodKind.Ordinary, IsStatic: true, ContainingType.IsInterface: true })); 1580constructor.ContainingType); 1990Debug.Assert(!meth.ContainingType.IsInterface);
Lowering\LocalRewriter\LocalRewriter_DelegateCreationExpression.cs (1)
35var receiver = (!method.RequiresInstanceReceiver && !node.IsExtensionMethod && !method.IsAbstract && !method.IsVirtual) ? _factory.Type(method.ContainingType) : VisitExpression(mg.ReceiverOpt)!;
Lowering\LocalRewriter\LocalRewriter_Event.cs (4)
24if (rewrittenReceiverOpt != null && node.Event.ContainingAssembly.IsLinked && node.Event.ContainingType.IsInterfaceType()) 26var @interface = node.Event.ContainingType; 278_diagnostics.Add(new CSDiagnosticInfo(ErrorCode.ERR_MissingPredefinedMember, invocationListProperty.ContainingType, accessorName), syntax.Location); 322BoundExpression eventInfo = _factory.New(ctor, _factory.Typeof(node.Event.ContainingType, ctor.Parameters[0].Type), _factory.Literal(node.Event.MetadataName));
Lowering\LocalRewriter\LocalRewriter_Field.cs (4)
26if (fieldSymbol.ContainingType.IsTupleType) 55var tupleType = tupleField.ContainingType; 72if (!TypeSymbol.Equals(underlyingField.ContainingType, currentLinkType, TypeCompareKind.ConsiderEverything2)) 91while (!TypeSymbol.Equals(underlyingField.ContainingType, currentLinkType, TypeCompareKind.ConsiderEverything2));
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (2)
345idisposableTypeSymbol = disposeMethod.ContainingType; 508if (!receiver.Type.IsReferenceType && method.ContainingType.IsInterface)
Lowering\LocalRewriter\LocalRewriter_IndexerAccess.cs (4)
284MethodSymbol createSpan = getCreateSpanHelper(node, spanType: getItemOrSliceHelper.ContainingType, intType: (NamedTypeSymbol)getItemOrSliceHelper.Parameters[0].Type); 456NamedTypeSymbol spanType = getItemOrSliceHelper.ContainingType; 1133if (method is { Name: nameof(string.Substring), ContainingType.SpecialType: SpecialType.System_String } 1145if (method is not { Name: WellKnownMemberNames.SliceMethodName, OriginalDefinition: var originalDefinition, ContainingType: NamedTypeSymbol containingType })
Lowering\LocalRewriter\LocalRewriter_Literal.cs (6)
73curMethod.ContainingType.SpecialType != SpecialType.System_Decimal) && 91if (useField is { HasUseSiteError: false, ContainingType: { HasUseSiteError: false } }) 133Debug.Assert(ctor.ContainingType.SpecialType == SpecialType.System_Decimal); 139constantValueOpt: constantValue, initializerExpressionOpt: null, type: ctor.ContainingType); 152Debug.Assert(ctor.ContainingType.SpecialType == SpecialType.System_DateTime); 159constantValueOpt: ConstantValue.NotAvailable, initializerExpressionOpt: null, type: ctor.ContainingType);
Lowering\LocalRewriter\LocalRewriter_NullCoalescingOperator.cs (1)
201if (method.IsStatic && method.ContainingType.SpecialType == SpecialType.System_String)
Lowering\LocalRewriter\LocalRewriter_ObjectCreationExpression.cs (2)
77rewrittenObjectCreation = node.Update(constructor, rewrittenArguments, argumentRefKindsOpt, MakeObjectCreationInitializerForExpressionTree(node.InitializerExpressionOpt), changeTypeOpt: constructor.ContainingType); 94rewrittenObjectCreation = node.Update(constructor, rewrittenArguments, argumentRefKindsOpt, newInitializerExpression: null, changeTypeOpt: constructor.ContainingType);
Lowering\LocalRewriter\LocalRewriter_ObjectOrCollectionInitializerExpression.cs (3)
701Debug.Assert(_compilation.Conversions.ClassifyConversionFromType(rewrittenReceiver.Type, memberSymbol.ContainingType, isChecked: false, ref discardedUseSiteInfo).IsImplicit || 702(memberSymbol.IsExtensionBlockMember() && !memberSymbol.IsStatic && ConversionsBase.IsValidExtensionMethodThisArgConversion(_compilation.Conversions.ClassifyConversionFromType(rewrittenReceiver.Type, memberSymbol.ContainingType.ExtensionParameter!.Type, isChecked: false, ref discardedUseSiteInfo))) || 703_compilation.Conversions.HasImplicitConversionToOrImplementsVarianceCompatibleInterface(rewrittenReceiver.Type, memberSymbol.ContainingType, ref discardedUseSiteInfo, out _));
Lowering\LocalRewriter\LocalRewriter_StringConcat.cs (2)
492var readOnlySpanOfChar = readOnlySpanCtorRefParamGeneric.ContainingType.Construct(charType); 541type: readOnlySpanCtorRefParamChar.ContainingType);
Lowering\LocalRewriter\LoweredDynamicOperationFactory.cs (1)
596return _factory.ArrayOrEmpty(argumentInfoFactory.ContainingType, infos);
Lowering\MethodToClassRewriter.cs (3)
325.AsMember((NamedTypeSymbol)this.VisitType(node.Field.ContainingType)); 334.AsMember((NamedTypeSymbol)this.VisitType(node.FieldSymbol.ContainingType)); 397TypeMap? typeMap = methodBeingWrapped.ContainingType is SubstitutedNamedTypeSymbol substitutedType ? substitutedType.TypeSubstitution : TypeMap.Empty;
Lowering\SpillSequenceSpiller.cs (2)
419var receiver = Spill(builder, field.ReceiverOpt, fieldSymbol.ContainingType.IsValueType ? refKind : RefKind.None); 936if (field.FieldSymbol.ContainingType.IsReferenceType)
Lowering\StateMachineRewriter\IteratorAndAsyncCaptureWalker.cs (2)
71if (!method.IsStatic && method.ContainingType.TypeKind == TypeKind.Struct && !isRuntimeAsync) 261case BoundFieldAccess { FieldSymbol: { IsStatic: false, ContainingType: { IsValueType: true } }, ReceiverOpt: BoundExpression receiver }:
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (1)
197get { return OriginalMethod.ContainingType; }
Lowering\StateMachineRewriter\RefInitializationHoister.cs (1)
202var isFieldOfStruct = !field.FieldSymbol.ContainingType.IsReferenceType;
Lowering\StateMachineRewriter\StateMachineRewriter.cs (2)
63Debug.Assert(TypeSymbol.Equals(F.CurrentType, method.ContainingType, TypeCompareKind.ConsiderEverything2)); 243var containingType = method.ContainingType;
Lowering\StateMachineRewriter\StateMachineTypeSymbol.cs (2)
36get { return KickoffMethod.ContainingType; } 62var kickoffType = KickoffMethod.ContainingType;
Lowering\StateMachineRewriter\SynthesizedStateMachineProperty.cs (2)
26_name = ExplicitInterfaceHelpers.GetMemberName(interfacePropertyGetter.AssociatedSymbol.Name, interfacePropertyGetter.ContainingType, aliasQualifierOpt: null); 27var getterName = ExplicitInterfaceHelpers.GetMemberName(interfacePropertyGetter.Name, interfacePropertyGetter.ContainingType, aliasQualifierOpt: null);
Lowering\SyntheticBoundNodeFactory.cs (9)
81_currentType = value.ContainingType; 109: this(topLevelMethod, topLevelMethod.ContainingType, node, compilationState, diagnostics, instrumentationState) 139Debug.Assert(TopLevelMethod is null || TypeSymbol.Equals(TopLevelMethod.ContainingType, CurrentType, TypeCompareKind.ConsiderEverything2)); 148TypeSymbol.Equals(CurrentFunction.ContainingType, CurrentType, TypeCompareKind.ConsiderEverything2)); 795constructor.ContainingType) 1341GetMethodFromHandleMethod(ctor.ContainingType, constructorInfo), 1440if (!method.ContainingType.IsValueType || !Microsoft.CodeAnalysis.CSharp.CodeGen.CodeGenerator.MayUseCallForStructMethod(this.CompilationState.Compilation.SourceModule, method)) 1448GetMethodFromHandleMethod(method.ContainingType, systemReflectionMethodInfo), 1464GetFieldFromHandleMethod(field.ContainingType),
Operations\CSharpOperationFactory.cs (1)
2649boundITuplePattern.GetLengthMethod.ContainingType.GetPublicSymbol(),
Symbols\AnonymousTypes\AnonymousTypeManager.SymbolCollection.cs (1)
104ReportErrorOnSymbol(symbol.ContainingType, diagnostics, ref hasError);
Symbols\AnonymousTypes\AnonymousTypeManager.Templates.cs (1)
733NamedTypeSymbol translatedType = TranslateAnonymousTypeSymbol(method.ContainingType);
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.FieldSymbol.cs (2)
109get { return _property.ContainingType; } 116return _property.ContainingType;
Symbols\ConstraintsHelper.cs (2)
935if (constructedContainingSymbol.IsExtensionBlockMember() && constructedContainingSymbol.ContainingType is { Arity: > 0 } extension 1617|| (method.IsExtensionBlockMember() && !method.ContainingType.IsDefinition));
Symbols\ConstructedMethodSymbol.cs (1)
20map: new TypeMap(constructedFrom.ContainingType, ((MethodSymbol)constructedFrom.OriginalDefinition).TypeParameters, typeArgumentsWithAnnotations),
Symbols\ErrorTypeSymbol.ErrorTypeParameterSymbol.cs (2)
197other.ContainingType.Equals(this.ContainingType, comparison);
Symbols\EventSymbol.cs (3)
351return TypeSymbol.Equals(this.ContainingType, other.ContainingType, compareKind) && ReferenceEquals(this.OriginalDefinition, other.OriginalDefinition); 357hash = Hash.Combine(this.ContainingType, hash);
Symbols\Extensions\SourceExtensionImplementationMethodSymbol.cs (4)
23: base(sourceMethod, TypeMap.Empty, sourceMethod.ContainingType.TypeParameters.Concat(sourceMethod.TypeParameters)) 26Debug.Assert(sourceMethod.IsStatic || sourceMethod.ContainingType.ExtensionParameter is not null); 65public sealed override Symbol ContainingSymbol => _originalMethod.ContainingType.ContainingSymbol; 127parameters.Add(new ExtensionMetadataMethodParameterSymbol(this, ((SourceNamedTypeSymbol)_originalMethod.ContainingType).ExtensionParameter!));
Symbols\FieldSymbol.cs (4)
438return ContainingType.IsTupleType ? this : null; 474if (!ContainingType.IsTupleType) 479if (!ContainingType.IsDefinition) 485int arity = ContainingType.Arity;
Symbols\MemberSymbolExtensions.cs (13)
111&& symbol.ContainingType.ExtensionParameter is { } foundExtensionParameter) 125return member.ContainingType.Arity + member.GetMemberArity(); 138? method.ContainingType.TypeParameters.Concat(method.TypeParameters) 145return property.ContainingType.TypeParameters; 157if (method.IsExtensionBlockMember() && method.Arity > 0 && method.ContainingType.Arity > 0) 159Debug.Assert(originalTypeParameters.Length == method.Arity + method.ContainingType.Arity); 186if (symbol.IsExtensionBlockMember() && symbol.ContainingType.ExtensionParameter is { } extensionParameter) 197bool hasExtensionParameter = symbol.IsExtensionBlockMember() && symbol.ContainingType.ExtensionParameter is { }; 211NamedTypeSymbol extension = method.ContainingType; 232NamedTypeSymbol extension = property.ContainingType; 375Debug.Assert(symbol.ContainingType.IsInterface); 645&& !(methodSymbol.HasThisConstructorInitializer(out var initializerSyntax) && !methodSymbol.ContainingType.IsDefaultValueTypeConstructor(initializerSyntax)) 701method.ContainingType?.IsValueType == true &&
Symbols\Metadata\PE\PEMethodSymbol.cs (5)
835Debug.Assert(TypeSymbol.Equals(propertyOrEventSymbol.ContainingType, _containingType, TypeCompareKind.ConsiderEverything2)); 1395if (!method.ContainingType.IsInterface) 1399(method.ContainingType.SpecialType == SpecialType.System_Object && 1417if (method.ContainingType.IsInterface) 1428if (method.ContainingType.IsClassType())
Symbols\Metadata\PE\PENamedTypeSymbol.cs (1)
478Debug.Assert(method.ContainingType == (object)this);
Symbols\Metadata\PE\PEParameterSymbol.cs (4)
310typeSymbol = NativeIntegerTypeDecoder.TransformType(typeSymbol, handle, moduleSymbol, containingSymbol.ContainingType); 381var markerMethod = ((PENamedTypeSymbol)containingSymbol.ContainingType).GetMarkerMethodSymbol(); 887&& ContainingType is PENamedTypeSymbol { IsExtension: true } containingPE 1267PEPropertySymbol => new MetadataDecoder(containingModule, (PENamedTypeSymbol)ContainingType),
Symbols\MethodSymbol.cs (8)
380internal virtual bool IsEffectivelyReadOnly => (IsDeclaredReadOnly || ContainingType?.IsReadOnly == true) && IsValidReadOnlyTarget; 382protected bool IsValidReadOnlyTarget => !IsStatic && ContainingType.IsStructType() && MethodKind != MethodKind.Constructor && !IsInitOnly; 668return MethodKind == MethodKind.Constructor && ContainingType.IsScriptClass; 836return this.ContainingType; 1064if (isGenericMethod(this) || ContainingType.IsGenericType) 1288if (methodToAttribute.ShouldCheckRequiredMembers() && methodToAttribute.ContainingType.HasAnyRequiredMembers) 1311if (methodToAttribute.ContainingType.IsClosed) 1326return this.ContainingType.TryGetCorrespondingExtensionImplementationMethod(this);
Symbols\MethodSymbolExtensions.cs (2)
61else if (method.ContainingType.SpecialType == SpecialType.System_Object) 221method.ContainingType is NamedTypeSymbol containingType &&
Symbols\NamedTypeSymbol.cs (3)
1970shadowingMethod.ContainingType.AllInterfacesNoUseSiteDiagnostics.Contains(method.ContainingType, Symbols.SymbolEqualityComparer.AllIgnoreOptions)) 2016Debug.Assert(factory.IsDefinition || factory.ContainingType.IsInterface);
Symbols\OverriddenOrHiddenMembersHelpers.cs (14)
114NamedTypeSymbol containingType = member.ContainingType; 183FindOverriddenOrHiddenMembers(member, member.ContainingType, memberIsFromSomeCompilation, out hiddenBuilder, 284if ((object)overriddenAccessor != null && IsOverriddenSymbolAccessible(overriddenAccessor, accessor.ContainingType) && 374if ((object)overriddenAccessor != null && IsOverriddenSymbolAccessible(overriddenAccessor, accessor.ContainingType) && 413NamedTypeSymbol containingType = member.ContainingType; 717(!representativeMember.ContainingType.IsDefinition || representativeMember.IsIndexer()); 792Debug.Assert(representativeMember.Kind == SymbolKind.Property || !representativeMember.ContainingType.IsDefinition); 796foreach (Symbol otherMember in representativeMember.ContainingType.GetMembers(representativeMember.Name)) 856Debug.Assert(representativeMember.Kind == SymbolKind.Property || !representativeMember.ContainingType.IsDefinition); 859foreach (Symbol otherMember in representativeMember.ContainingType.GetMembers(representativeMember.Name)) 975csharpOverriddenMethod.ContainingType.Equals(runtimeOverriddenMethod.ContainingType, TypeCompareKind.CLRSignatureCompareOptions); 991foreach (Symbol otherMethod in method.ContainingType.GetMembers(method.Name)) 1025NamedTypeSymbol containingType = method.ContainingType;
Symbols\OverriddenOrHiddenMembersResult.cs (2)
60NamedTypeSymbol overriddenByDefinitionContaining = overriddenByDefinitionMember.ContainingType; 62for (NamedTypeSymbol baseType = substitutedOverridingMember.ContainingType.BaseTypeNoUseSiteDiagnostics;
Symbols\ParameterSymbol.cs (1)
170(refKind == RefKind.Ref && ContainingSymbol.ContainingType.IsComImport));
Symbols\PropertySymbol.cs (3)
473return TypeSymbol.Equals(this.ContainingType, other.ContainingType, compareKind) && ReferenceEquals(this.OriginalDefinition, other.OriginalDefinition); 479hash = Hash.Combine(this.ContainingType, hash);
Symbols\PublicModel\MethodSymbol.cs (2)
365var enclosing = _underlying.ContainingType.ContainingType; 370typeArguments.AddRange(_underlying.ContainingType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics);
Symbols\PublicModel\Symbol.cs (1)
75return UnderlyingSymbol.ContainingType.GetPublicSymbol();
Symbols\Retargeting\RetargetingMethodSymbol.cs (1)
140new TypeWithAnnotations.Boxed(this.RetargetingTranslator.Retarget(_underlyingMethod.ReturnTypeWithAnnotations, RetargetOptions.RetargetPrimitiveTypesByTypeCode, this.ContainingType)),
Symbols\Retargeting\RetargetingNamedTypeSymbol.cs (1)
120Debug.Assert(method.ContainingType == (object)this);
Symbols\Retargeting\RetargetingPropertySymbol.cs (1)
71if (type.Type.TryAsDynamicIfNoPia(this.ContainingType, out TypeSymbol asDynamic))
Symbols\Retargeting\RetargetingSymbolTranslator.cs (5)
891var containingType = method.ContainingType; 939var containingType = property.ContainingType; 955var containingType = @event.ContainingType; 1055NamedTypeSymbol containingType = _toFind.ContainingType; 1167newAttributeType = newAttributeCtor.ContainingType;
Symbols\Source\ExplicitInterfaceHelpers.cs (5)
130var unsubstitutedInterfaceType = unsubstitutedPropertyImplemented.ContainingType; 193var containingType = implementingMember.ContainingType; 344if (!AccessCheck.IsSymbolAccessible(implementedMember, implementingMember.ContainingType, ref useSiteInfo, throughTypeOpt: null)) 368!AccessCheck.IsSymbolAccessible(accessor, implementingMember.ContainingType, ref useSiteInfo, throughTypeOpt: null)) 421NamedTypeSymbol explicitInterfaceType = implementedMember.ContainingType;
Symbols\Source\FieldSymbolWithAttributesAndModifiers.cs (4)
152var containingSourceType = (SourceMemberContainerTypeSymbol)ContainingType; 333if (this.ContainingType.Layout.Kind != LayoutKind.Explicit) 344if (this.ContainingType.Layout.Kind == LayoutKind.Explicit) 426AddSynthesizedAttribute(ref attributes, moduleBuilder.SynthesizeNullableAttributeIfNecessary(this, ContainingType.GetNullableContextValue(), type));
Symbols\Source\ModifierUtils.cs (4)
538if (symbol.ContainingType?.IsInterface == true && !symbol.ContainingAssembly.RuntimeSupportsDefaultInterfaceImplementation) 554case FieldSymbol when !symbol.IsAsRestrictive(symbol.ContainingType, ref useSiteInfo): 555case PropertySymbol { SetMethod: { } method } when !method.IsAsRestrictive(symbol.ContainingType, ref useSiteInfo): 557diagnostics.Add(ErrorCode.ERR_RequiredMemberCannotBeLessVisibleThanContainingType, errorLocation, symbol, symbol.ContainingType);
Symbols\Source\ParameterHelpers.cs (5)
219typeParameters = owner.ContainingType.TypeParameters.Concat(typeParameters); 221if (owner.ContainingType.ExtensionParameter is { Name: not "" } receiver) 534NamedTypeSymbol extension = extensionMember.ContainingType; 876|| (containingSymbol is FunctionPointerMethodSymbol or { ContainingType: not null }) 883ErrorFacts.GetStaticClassParameterCode(containingSymbol?.ContainingType?.IsInterfaceType() ?? false),
Symbols\Source\SourceAssemblySymbol.cs (5)
2234if ((object)forwardedType.ContainingType != null) 2236diagnostics.Add(ErrorCode.ERR_ForwardedTypeIsNested, GetAssemblyAttributeLocationForDiagnostic(arguments.AttributeSyntaxOpt), forwardedType, forwardedType.ContainingType); 2633var container = field.ContainingType as SourceMemberContainerTypeSymbol; 2727var containingType = field.ContainingType as SourceNamedTypeSymbol; 2788var containingType = field.ContainingType as SourceNamedTypeSymbol;
Symbols\Source\SourceComplexParameterSymbol.cs (3)
710if (parameter.ContainingType.ExtensionParameter is { } extensionParameter 1312ParameterSymbol? extensionParameter = ContainingType.ExtensionParameter; 1731method.ContainingType.IsAtLeastAsVisibleAs(ContainingSymbol, ref useSiteInfo);
Symbols\Source\SourceEventAccessorSymbol.cs (1)
63name = ExplicitInterfaceHelpers.GetMemberName(accessorName, explicitlyImplementedEventOpt.ContainingType, aliasQualifierOpt);
Symbols\Source\SourceMemberContainerSymbol.cs (11)
1003for (Symbol? container = this.ContainingType; !(container is null); container = container.ContainingType) 2355((ConstructorDeclarationSyntax)constructor.SyntaxRef.GetSyntax()).Identifier.ValueText != method1.ContainingType.Name) 2363((object)underlying1.ContainingType == underlying2.ContainingType || 2364underlying1.ContainingType.ExtensionGroupingName == underlying2.ContainingType.ExtensionGroupingName) && 2400"~" + method1.ContainingType.Name : 2401(method1.IsConstructor() ? method1.ContainingType.Name : method1.Name); 2442if (indexer.ContainingType.Arity > 0) 2445foreach (TypeParameterSymbol typeParameter in indexer.ContainingType.TypeParameters) 3105if (method.IsOverride && method.GetConstructedLeastOverriddenMethod(this, requireSameReturnType: false).ContainingType.SpecialType == Microsoft.CodeAnalysis.SpecialType.System_Object)
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (15)
256(!implementingMember.ContainingType.Equals(this, TypeCompareKind.ConsiderEverything) && 269wasImplementingMemberFound && implementingMember.ContainingType.IsInterface) 271HasBaseInterfaceDeclaringInterface(implementingMember.ContainingType, @interface, ref matchResult); 320if (synthesizedImplementation.ForwardingMethod is not null || TypeSymbol.Equals(implementingMember.ContainingType, this, TypeCompareKind.ConsiderEverything2)) 696if (symbol.ContainingType.IsInterface) 850NamedTypeSymbol overridingType = overridingMember.ContainingType; 889var overridingType = overridingMember.ContainingType; 1075var overridingType = overridingProperty.ContainingType; 1580var leastOverriddenMember = implementedMember ?? overridingMember.GetLeastOverriddenMember(overridingMember.ContainingType); 1650if (!hidingMember.ContainingType.IsInterface) 1725if (!hiddenMember.IsAbstract || !hidingMember.ContainingType.IsAbstract) 1903IsOverrideOfPossibleImplementationUnderRuntimeRules(implementingMethod, @interfaceMethod.ContainingType)) 1927if (implementingMethod.ContainingType != (object)this) 1929if (implementingMethod.ContainingType.IsInterface || 1968NamedTypeSymbol type = implementingMethod.ContainingType;
Symbols\Source\SourceMethodSymbol.cs (4)
50else if (ContainingType is SourceMemberContainerTypeSymbol type) 161if (target.IsDeclaredReadOnly && !target.ContainingType.IsReadOnly) 236!target.ContainingType.IsImplicitlyDeclared && 296AddSynthesizedAttribute(ref attributes, moduleBuilder.SynthesizeExtensionMarkerAttribute(target, ((SourceNamedTypeSymbol)target.ContainingType).ExtensionMarkerName));
Symbols\Source\SourceMethodSymbolWithAttributes.cs (14)
538AttributeData.DecodeMethodImplAttribute<MethodWellKnownAttributeData, AttributeSyntax, CSharpAttributeData, AttributeLocation>(ref arguments, MessageProvider.Instance, this.ContainingType); 605CSharpAttributeData.DecodeMemberNotNullAttribute<MethodWellKnownAttributeData>(ContainingType, ref arguments); 610CSharpAttributeData.DecodeMemberNotNullWhenAttribute<MethodWellKnownAttributeData>(ContainingType, ref arguments); 632if (ContainingType.IsInterface || IsExplicitInterfaceImplementation) 740else if (this.ContainingType.IsInterfaceType()) 858if (isAnyNestedMethodGeneric || ContainingType?.IsGenericType == true) 968Debug.Assert(ContainingType is object); 986if (IsGenericMethod || ContainingType.IsGenericType) 1366if (!this.IsExtensionBlockMember() && ContainingType.IsGenericType) 1505diagnostics.Add(ErrorCode.ERR_ComImportWithImpl, this.GetFirstLocation(), this, ContainingType); 1517&& !this.ContainingType.IsComImport) 1573for (NamedTypeSymbol curr = this.ContainingType; (object)curr != null; curr = curr.ContainingType) 1665return this.ContainingType.IsInterface && 1757if (this.ContainingType.IsComImport && this.MethodKind == MethodKind.Constructor)
Symbols\Source\SourceNamedTypeSymbol.cs (1)
231diagnostics.Add(ErrorCode.WRN_TypeParameterSameAsOuterTypeParameter, location, name, tpEnclosing.ContainingType);
Symbols\Source\SourceNamedTypeSymbol_Extension.cs (5)
266if (typeParameter.ContainingType.IsExtension) 1035Debug.Assert(method.ContainingType == (object)this); 1179NamedTypeSymbol extension = extensionMember.ContainingType; 1205Debug.Assert(result.ContainingType.ExtensionParameter is not null); 1207Conversion conversion = conversions.ConvertExtensionMethodThisArg(parameterType: result.ContainingType.ExtensionParameter.Type, receiverType, ref discardedUseSiteInfo, isMethodGroupConversion: false);
Symbols\Source\SourceOrdinaryMethodSymbol.cs (1)
1213diagnostics.Add(ErrorCode.WRN_TypeParameterSameAsOuterTypeParameter, location, name, tpEnclosing.ContainingType);
Symbols\Source\SourcePropertyAccessorSymbol.cs (1)
743name = ExplicitInterfaceHelpers.GetMemberName(accessorName, explicitlyImplementedPropertyOpt.ContainingType, aliasQualifierOpt);
Symbols\Source\SynthesizedAttributeData.cs (1)
47public override NamedTypeSymbol AttributeClass => _wellKnownMember.ContainingType;
Symbols\Source\ThisParameterSymbol.cs (2)
139internal ThisParameterSymbol(MethodSymbol forMethod) : this(forMethod, forMethod.ContainingType) 157if (ContainingType?.TypeKind != TypeKind.Struct)
Symbols\SubstitutedFieldSymbol.cs (2)
121return (object)other != null && TypeSymbol.Equals(_containingType, other.ContainingType, compareKind) && OriginalDefinition == other.OriginalDefinition; 133if (containingHashCode != this.OriginalDefinition.ContainingType.GetHashCode())
Symbols\SubstitutedMethodSymbol.cs (4)
45Debug.Assert(TypeSymbol.Equals(originalDefinition.ContainingType, containingSymbol.OriginalDefinition, TypeCompareKind.ConsiderEverything2)); 207return _containingSymbol is NamedTypeSymbol nt ? nt : _containingSymbol.ContainingType; 385if (containingHashCode == this.OriginalDefinition.ContainingType.GetHashCode() && 453if (!TypeSymbol.Equals(this.ContainingType, other.ContainingType, compareKind)) return false;
Symbols\Symbol.cs (5)
136return container.ContainingType; 257if (ContainingType?.TypeKind == TypeKind.Submission) 279if (ContainingType.TypeKind == TypeKind.Submission) 290Debug.Assert(ContainingType.TypeKind != TypeKind.Submission); 326return this.ContainingType;
Symbols\SymbolExtensions.cs (4)
42return symbol is NamedTypeSymbol && (object?)symbol.ContainingType != null; 181type = symbol.ContainingType; 304var upperLevelType = symbol.Kind == SymbolKind.NamedType ? (NamedTypeSymbol)symbol : symbol.ContainingType; 528return !symbol.IsSealed && (symbol.IsAbstract || symbol.IsVirtual) && (symbol.ContainingType?.IsInterface ?? false);
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListEnumeratorTypeSymbol.cs (4)
55var containingType = (SynthesizedReadOnlyListEnumeratorTypeSymbol)method.ContainingType; 75var containingType = (SynthesizedReadOnlyListEnumeratorTypeSymbol)method.ContainingType; 87var containingType = (SynthesizedReadOnlyListEnumeratorTypeSymbol)method.ContainingType; 106var containingType = (SynthesizedReadOnlyListEnumeratorTypeSymbol)method.ContainingType;
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListProperty.cs (1)
26Name = ExplicitInterfaceHelpers.GetMemberName(interfaceProperty.Name, interfaceProperty.ContainingType, aliasQualifierOpt: null);
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListTypeSymbol.cs (16)
474var containingType = (SynthesizedReadOnlyListTypeSymbol)method.ContainingType; 487NamedTypeSymbol interfaceType = interfaceMethod.ContainingType; 506var containingType = (SynthesizedReadOnlyListTypeSymbol)method.ContainingType; 573var containingType = (SynthesizedReadOnlyListTypeSymbol)method.ContainingType; 583else if (containingType.IsArray || !interfaceMethod.ContainingType.IsGenericType) 586NamedTypeSymbol interfaceType = interfaceMethod.ContainingType; 616var containingType = (SynthesizedReadOnlyListTypeSymbol)method.ContainingType; 624if (!interfaceMethod.ContainingType.IsGenericType) 649else if (containingType.IsArray || !interfaceMethod.ContainingType.IsGenericType) 652NamedTypeSymbol interfaceType = interfaceMethod.ContainingType; 685var containingType = (SynthesizedReadOnlyListTypeSymbol)method.ContainingType; 719var containingType = (SynthesizedReadOnlyListTypeSymbol)method.ContainingType; 733else if (containingType.IsArray || !interfaceMethod.ContainingType.IsGenericType) 736NamedTypeSymbol interfaceType = interfaceMethod.ContainingType; 789var equalityComparerType = equalityComparer_Equals.ContainingType; 818Debug.Assert(_field.Type.OriginalDefinition.Equals(symbol.ContainingType, TypeCompareKind.AllIgnoreOptions));
Symbols\Synthesized\Records\SynthesizedPrimaryConstructorParameterBackingFieldSymbol.cs (1)
71=> ParameterSymbol.ContainingSymbol.ContainingType;
Symbols\Synthesized\Records\SynthesizedRecordBaseEquals.cs (1)
45!overridden.ContainingType.Equals(ContainingType.BaseTypeNoUseSiteDiagnostics, TypeCompareKind.AllIgnoreOptions))
Symbols\Synthesized\Records\SynthesizedRecordCopyCtor.cs (2)
135if (member is MethodSymbol { ContainingType.IsRecord: true, MethodKind: MethodKind.Constructor } method) 145NamedTypeSymbol containingType = member.ContainingType;
Symbols\Synthesized\Records\SynthesizedRecordEqualityContractProperty.cs (2)
106var baseType = overriding.ContainingType.BaseTypeNoUseSiteDiagnostics; 130!overridden.ContainingType.Equals(baseType, TypeCompareKind.AllIgnoreOptions))
Symbols\Synthesized\Records\SynthesizedRecordEquals.cs (2)
107if (baseEquals is null || !baseEquals.ContainingType.Equals(ContainingType.BaseTypeNoUseSiteDiagnostics, TypeCompareKind.AllIgnoreOptions) || 135F.Base(baseEquals.ContainingType),
Symbols\Synthesized\Records\SynthesizedRecordGetHashCode.cs (1)
95currentHashValue = F.Call(F.Base(overridden.ContainingType), overridden);
Symbols\Synthesized\Records\SynthesizedRecordObjectMethod.cs (1)
43if (overridden is object && !(overridden.ContainingType is SourceMemberContainerTypeSymbol { IsRecord: true } && overridden.ContainingModule == overriding.ContainingModule))
Symbols\Synthesized\Records\SynthesizedRecordPrintMembers.cs (3)
110!overridden.ContainingType.Equals(ContainingType.BaseTypeNoUseSiteDiagnostics, TypeCompareKind.AllIgnoreOptions)) 276NamedTypeSymbol baseType = overriding.ContainingType.BaseTypeNoUseSiteDiagnostics; 300!overridden.ContainingType.Equals(baseType, TypeCompareKind.AllIgnoreOptions))
Symbols\Synthesized\Records\SynthesizedRecordPropertySymbol.cs (1)
106parameter.ContainingType.GetMembersUnordered().Any((s, parameter) => (s as SynthesizedRecordPropertySymbol)?.BackingParameter == (object)parameter, parameter);
Symbols\Synthesized\SynthesizedBackingFieldSymbol.cs (1)
50if (!this.ContainingType.IsImplicitlyDeclared)
Symbols\Synthesized\SynthesizedEntryPointSymbol.cs (2)
29var containingType = initializerMethod.ContainingType; 261get { return ContainingType.AreLocalsZeroed; }
Symbols\Synthesized\SynthesizedHotReloadExceptionConstructorSymbol.cs (1)
59!parameter.Type.Equals(exceptionConstructor.ContainingType))
Symbols\Synthesized\SynthesizedImplementationMethod.cs (2)
38_name = name ?? ExplicitInterfaceHelpers.GetMemberName(interfaceMethod.Name, interfaceMethod.ContainingType, aliasQualifierOpt: null); 45var typeMap = interfaceMethod.ContainingType.TypeSubstitution ?? TypeMap.Empty;
Symbols\Synthesized\SynthesizedMethodSymbol.cs (1)
41return ContainingType.AreLocalsZeroed;
Symbols\Synthesized\SynthesizedSealedPropertyAccessor.cs (2)
52return _property.ContainingType; 95Debug.Assert(AccessCheck.IsSymbolAccessible(_overriddenAccessor, this.ContainingType, ref discardedUseSiteInfo));
Symbols\Tuples\TupleFieldSymbol.cs (4)
47Debug.Assert(container.Equals(underlyingField.ContainingType, TypeCompareKind.IgnoreDynamicAndTupleNames) || this is TupleVirtualElementFieldSymbol, 108NamedTypeSymbol originalContainer = ContainingType.OriginalDefinition; 270Debug.Assert(underlyingField.ContainingType.IsTupleType); 272Debug.Assert(name != underlyingField.Name || !container.Equals(underlyingField.ContainingType, TypeCompareKind.IgnoreDynamicAndTupleNames),
Symbols\Tuples\TupleTypeSymbol.cs (1)
1112if (TypeSymbol.Equals(underlyingMemberDefinition.ContainingType, TupleUnderlyingType.OriginalDefinition, TypeCompareKind.ConsiderEverything))
Symbols\TypeParameterSymbol.cs (2)
674return other.ContainingSymbol.ContainingType.Equals(this.ContainingSymbol.ContainingType, comparison);
Symbols\TypeSymbol.cs (21)
734var interfaceType = interfaceMember.ContainingType; 813NamedTypeSymbol interfaceType = interfaceMember.ContainingType; 1102return !symbolAndDiagnostics.Symbol.ContainingType.IsInterface; 1245NamedTypeSymbol implementingInterface = inplementingAccessor1.ContainingType; 1247if (implementingAccessor2 is object && !implementingInterface.Equals(implementingAccessor2.ContainingType, TypeCompareKind.ConsiderEverything)) 1292NamedTypeSymbol previousContainingType = previous.ContainingType; 1328if (bases.ContainsKey(implementations[i].MethodSet.First().ContainingType)) 1387NamedTypeSymbol containingType = interfaceMember.ContainingType; 1521currType.InterfacesAndTheirBaseInterfacesWithDefinitionUseSiteDiagnostics(ref useSiteInfo).ContainsKey(interfaceAccessor.ContainingType)) 1569if ((object)implementingPropertyOrEvent != null && !implementingPropertyOrEvent.ContainingType.IsInterface) 1600else if ((object)correspondingImplementingAccessor != null && ((object)implicitImpl == null || TypeSymbol.Equals(correspondingImplementingAccessor.ContainingType, implicitImpl.ContainingType, TypeCompareKind.ConsiderEverything2))) 1611interfaceMethod.ContainingType, 1732if (!implicitImpl.ContainingType.IsDefinition) 1734foreach (Symbol member in implicitImpl.ContainingType.GetMembers(implicitImpl.Name)) 2106var @interface = interfaceMember.ContainingType; 2165if (TypeSymbol.Equals(member.ContainingType, implementingType, TypeCompareKind.ConsiderEverything2)) 2171var @interface = interfaceMember.ContainingType; 2390x.ContainingType.Equals(y.ContainingType, TypeCompareKind.CLRSignatureCompareOptions); 2574if (elementField is not null && elementField.ContainingType.IsGenericType)
Symbols\TypeSymbolExtensions.cs (16)
828var containingType = current.ContainingType; 842RoslynDebug.Assert((object)current.ContainingType == null); 1089var parent1 = s1.ContainingType; 1099for (var parent2 = s2.ContainingType; (object)parent2 != null; parent2 = parent2.ContainingType) 1111var parent2 = s2.ContainingType; 1123var parent1 = s1.ContainingType; 1141for (var parent2 = s2.ContainingType; (object)parent2 != null; parent2 = parent2.ContainingType) 1164if (parent1.IsAccessibleViaInheritance(s2.ContainingType, ref useSiteInfo)) 1175parent1.IsAccessibleViaInheritance(s2.ContainingType, ref useSiteInfo)) 1186parent1.IsAccessibleViaInheritance(s2.ContainingType, ref useSiteInfo)) 1201NamedTypeSymbol parent1 = s1.ContainingType; 1209for (var parent2 = s2.ContainingType; (object)parent2 != null; parent2 = parent2.ContainingType) 1293FindTypeParameters(method.ContainingType, result); 2237if (typeSymbol.Name != name || typeSymbol.ContainingType is object) 2256=> typeSymbol.ContainingType is null && IsContainedInNamespace(typeSymbol, "System", "Runtime", "CompilerServices"); 2269=> typeSymbol.ContainingType is null && IsContainedInNamespace(typeSymbol, "System", "Diagnostics", "CodeAnalysis");
Symbols\VarianceSafety.cs (1)
101for (var container = member.ContainingType; container is object; container = container.ContainingType)