47 references to ContainingType
Microsoft.CodeAnalysis.CSharp (47)
Binder\Binder.cs (1)
650ReportDiagnosticsIfObsolete(diagnostics, symbol, node, hasBaseReceiver, this.ContainingMemberOrLambda, this.ContainingType, this.Flags);
Binder\Binder.ValueChecks.cs (2)
2073Error(diagnostics, ErrorCode.ERR_BadProtectedAccess, node, propertySymbol, accessThroughType, this.ContainingType); 2123Error(diagnostics, ErrorCode.ERR_BadProtectedAccess, node, propertySymbol, accessThroughType, this.ContainingType);
Binder\Binder_Attributes.cs (1)
644var propertySymbol = ((PropertySymbol)namedArgumentNameSymbol).GetLeastOverriddenProperty(this.ContainingType);
Binder\Binder_Conversions.cs (2)
3424if (InFieldInitializer && !ContainingType!.IsScriptClass || InConstructorInitializer || InAttributeArgument) 3447var containingType = this.ContainingType;
Binder\Binder_Crefs.cs (3)
380NamedTypeSymbol? containingType = ContainingType; 626if (containerType.Name == memberName && (hasParameterList || containerType.Arity == 0 || !TypeSymbol.Equals(this.ContainingType, containerType.OriginalDefinition, TypeCompareKind.ConsiderEverything2))) 637NamedTypeSymbol? binderContainingType = this.ContainingType;
Binder\Binder_Deconstruct.cs (1)
947BoundThisReference receiver = ThisReference(designation, this.ContainingType, hasErrors: false,
Binder\Binder_Expressions.cs (13)
1482Debug.Assert(ContainingType is { }); 1840ContainingType is SourceMemberContainerTypeSymbol { IsRecord: false, IsRecordStruct: false, PrimaryConstructor: SynthesizedPrimaryConstructor { ParameterCount: not 0 } primaryConstructor, OriginalDefinition: var containingTypeDefinition } && 2019var currentType = this.ContainingType; 2283ContainingType, 2382var currentType = this.ContainingType; 2447if (this.ContainingType.TypeKind == TypeKind.Submission 2593return ThisReference(node, this.ContainingType, hasErrors); 2633TypeSymbol baseType = this.ContainingType is null ? null : this.ContainingType.BaseTypeNoUseSiteDiagnostics; 2647else if (this.ContainingType is null || node.Parent is null || (node.Parent.Kind() != SyntaxKind.SimpleMemberAccessExpression && node.Parent.Kind() != SyntaxKind.ElementAccessExpression)) 3388foreach (Symbol member in ContainingType?.GetMembers(identifier) ?? ImmutableArray<Symbol>.Empty) 6798NamedTypeSymbol containingType = this.ContainingType; 9975var containingType = this.ContainingType;
Binder\Binder_Invocation.cs (6)
434Debug.Assert(ContainingType is not null); 443receiverOpt: new BoundTypeExpression(node, null, this.ContainingType).MakeCompilerGenerated(), 1121else if (call.ReceiverOpt.Kind == BoundKind.BaseReference && this.ContainingType.IsRestrictedType()) 1123SymbolDistinguisher distinguisher = new SymbolDistinguisher(compilation, this.ContainingType, call.Method.ContainingType); 2112: this.ContainingType; 2353var methodContainer = expr.Type ?? this.ContainingType;
Binder\Binder_Lookup.cs (3)
1564diagInfo = new CSDiagnosticInfo(ErrorCode.ERR_BadProtectedAccess, unwrappedSymbol, accessThroughType, this.ContainingType); 1657var property = ((PropertySymbol)symbol).GetLeastOverriddenProperty(this.ContainingType); 1664var @event = ((EventSymbol)symbol).GetLeastOverriddenEvent(this.ContainingType);
Binder\Binder_Operators.cs (2)
3828existing.Add(method.GetLeastOverriddenMethod(ContainingType)); 3833if (IsViableInstanceOperator(method, parameterCount) && !existing.Contains(method.GetLeastOverriddenMethod(ContainingType)))
Binder\Binder_Statements.cs (6)
1793var leastOverridden = (EventSymbol)eventSymbol.GetLeastOverriddenMember(this.ContainingType); 1851return this.ContainingType; 3827else if (ContainingType is SourceMemberContainerTypeSymbol { IsUnionDeclaration: true }) 3834&& ContainingType.IsDefaultValueTypeConstructor(initializer); 3843else if (ContainingType is SourceMemberContainerTypeSymbol { IsUnionDeclaration: true }) 3860ContainingType is SourceMemberContainerTypeSymbol { HasPrimaryConstructor: true };
Binder\BinderFactory.BinderFactoryVisitor.cs (1)
1343for (NamedTypeSymbol curr = outerBinder.ContainingType; (object)curr != null; curr = curr.ContainingType)
Binder\ExpressionVariableFinder.cs (3)
606NamedTypeSymbol? container = _scopeBinder.ContainingType; 627NamedTypeSymbol? container = _scopeBinder.ContainingType; 654NamedTypeSymbol container = _scopeBinder.ContainingType;
Binder\Semantics\OverloadResolution\OverloadResolution.cs (1)
1152var leastOverriddenMember = (TMember)member.GetLeastOverriddenMember(_binder.ContainingType);
Compilation\CSharpSemanticModel.cs (2)
1607TypeSymbol containingType = binder.ContainingType; 3702NamedTypeSymbol containingType = binder.ContainingType;