44 references to ContainingType
Microsoft.CodeAnalysis.CSharp (44)
Binder\Binder.cs (1)
611ReportDiagnosticsIfObsolete(diagnostics, symbol, node, hasBaseReceiver, this.ContainingMemberOrLambda, this.ContainingType, this.Flags);
Binder\Binder.ValueChecks.cs (2)
1797Error(diagnostics, ErrorCode.ERR_BadProtectedAccess, node, propertySymbol, accessThroughType, this.ContainingType); 1846Error(diagnostics, ErrorCode.ERR_BadProtectedAccess, node, propertySymbol, accessThroughType, this.ContainingType);
Binder\Binder_Attributes.cs (1)
636var propertySymbol = ((PropertySymbol)namedArgumentNameSymbol).GetLeastOverriddenProperty(this.ContainingType);
Binder\Binder_Conversions.cs (2)
2734if (InFieldInitializer && !ContainingType!.IsScriptClass || InConstructorInitializer || InAttributeArgument) 2757var containingType = this.ContainingType;
Binder\Binder_Crefs.cs (2)
580if (containerType.Name == memberName && (hasParameterList || containerType.Arity == 0 || !TypeSymbol.Equals(this.ContainingType, containerType.OriginalDefinition, TypeCompareKind.ConsiderEverything2))) 591NamedTypeSymbol? binderContainingType = this.ContainingType;
Binder\Binder_Deconstruct.cs (1)
945BoundThisReference receiver = ThisReference(designation, this.ContainingType, hasErrors: false,
Binder\Binder_Expressions.cs (13)
1447Debug.Assert(ContainingType is { }); 1768ContainingType is SourceMemberContainerTypeSymbol { IsRecord: false, IsRecordStruct: false, PrimaryConstructor: SynthesizedPrimaryConstructor { ParameterCount: not 0 } primaryConstructor, OriginalDefinition: var containingTypeDefinition } && 1948var currentType = this.ContainingType; 2048ContainingType, 2303var currentType = this.ContainingType; 2368if (this.ContainingType.TypeKind == TypeKind.Submission 2514return ThisReference(node, this.ContainingType, hasErrors); 2554TypeSymbol baseType = this.ContainingType is null ? null : this.ContainingType.BaseTypeNoUseSiteDiagnostics; 2568else if (this.ContainingType is null || node.Parent is null || (node.Parent.Kind() != SyntaxKind.SimpleMemberAccessExpression && node.Parent.Kind() != SyntaxKind.ElementAccessExpression)) 3309foreach (Symbol member in ContainingType?.GetMembers(identifier) ?? ImmutableArray<Symbol>.Empty) 6634NamedTypeSymbol containingType = this.ContainingType; 9053var containingType = this.ContainingType;
Binder\Binder_Invocation.cs (6)
427Debug.Assert(ContainingType is not null); 436receiverOpt: new BoundTypeExpression(node, null, this.ContainingType).MakeCompilerGenerated(), 1073else if (call.ReceiverOpt.Kind == BoundKind.BaseReference && this.ContainingType.IsRestrictedType()) 1075SymbolDistinguisher distinguisher = new SymbolDistinguisher(compilation, this.ContainingType, call.Method.ContainingType); 2016: this.ContainingType; 2255var methodContainer = expr.Type ?? this.ContainingType;
Binder\Binder_Lookup.cs (3)
1550diagInfo = new CSDiagnosticInfo(ErrorCode.ERR_BadProtectedAccess, unwrappedSymbol, accessThroughType, this.ContainingType); 1643var property = ((PropertySymbol)symbol).GetLeastOverriddenProperty(this.ContainingType); 1650var @event = ((EventSymbol)symbol).GetLeastOverriddenEvent(this.ContainingType);
Binder\Binder_Operators.cs (2)
3558existing.Add(method.GetLeastOverriddenMethod(ContainingType)); 3563if (IsViableInstanceOperator(method, parameterCount) && !existing.Contains(method.GetLeastOverriddenMethod(ContainingType)))
Binder\Binder_Statements.cs (4)
1762var leastOverridden = (EventSymbol)eventSymbol.GetLeastOverriddenMember(this.ContainingType); 1820return this.ContainingType; 3752&& ContainingType.IsDefaultValueTypeConstructor(initializer); 3772ContainingType is SourceMemberContainerTypeSymbol { HasPrimaryConstructor: true };
Binder\BinderFactory.BinderFactoryVisitor.cs (1)
1329for (NamedTypeSymbol curr = outerBinder.ContainingType; (object)curr != null; curr = curr.ContainingType)
Binder\ExpressionVariableFinder.cs (3)
599NamedTypeSymbol container = _scopeBinder.ContainingType; 620NamedTypeSymbol container = _scopeBinder.ContainingType; 645NamedTypeSymbol container = _scopeBinder.ContainingType;
Binder\Semantics\OverloadResolution\OverloadResolution.cs (1)
1150var leastOverriddenMember = (TMember)member.GetLeastOverriddenMember(_binder.ContainingType);
Compilation\CSharpSemanticModel.cs (2)
1594TypeSymbol containingType = binder.ContainingType; 3694NamedTypeSymbol containingType = binder.ContainingType;