Binder\Binder_Expressions.cs (13)
51var containingType = memberOpt?.ContainingType;
1476var implicitReceiver = field.IsStatic ? null : ThisReference(node, field.ContainingType, wasCompilerGenerated: true);
2290NamedTypeSymbol declaringType = member.ContainingType;
4808NamedTypeSymbol containingType = constructor.ContainingType;
4968NamedTypeSymbol baseType = constructor.ContainingType.BaseTypeNoUseSiteDiagnostics;
5093if (resultMember is null || resultMember.ContainingType.SpecialType != SpecialType.System_Object)
5140return constructor.ContainingType is SourceNamedTypeSymbol sourceType &&
6117constructor.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.
6122return constructor.ContainingType.AllRequiredMembers;
6636this.IsSymbolAccessibleConditional(constructor, containingType, ref useSiteInfo, constructor.ContainingType);
8553NamedTypeSymbol type = fieldSymbol.ContainingType;
8726if (symbol.ContainingType?.IsInterface == true)
10251return new ErrorPropertySymbol(candidate.ContainingType, propertyType, candidate.Name, candidate.IsIndexer, candidate.IsIndexedProperty);
BoundTree\Constructors.cs (3)
62!fieldSymbol.ContainingType.IsValueType ||
254: this(syntax, constructor, ImmutableArray.Create<BoundExpression>(arguments), default(ImmutableArray<string?>), default(ImmutableArray<RefKind>), false, default(ImmutableArray<int>), default(BitVector), null, null, constructor.ContainingType)
258: this(syntax, constructor, arguments, default(ImmutableArray<string?>), default(ImmutableArray<RefKind>), false, default(ImmutableArray<int>), default(BitVector), null, null, constructor.ContainingType)
Compiler\MethodCompiler.cs (13)
243synthesizedEntryPoint = new SynthesizedEntryPointSymbol.AsyncForwardEntryPoint(compilation, entryPoint.ContainingType, entryPoint);
247moduleBeingBuilt.AddSynthesizedDefinition(entryPoint.ContainingType, synthesizedEntryPoint.GetCciAdapter());
277new TypeCompilationState(synthesizedEntryPoint.ContainingType, compilation, moduleBeingBuilt),
835if (!interfaces.Contains(synthesizedExplicitImpl.ExplicitInterfaceImplementations[0].ContainingType,
899if (methodSymbol.IsAbstract || methodSymbol.ContainingType?.IsDelegateType() == true)
1025Debug.Assert(!prependedDefaultValueTypeConstructorInitializer || methodSymbol.ContainingType.IsStructType());
1039((methodSymbol.ContainingType.IsStructType() && !methodSymbol.IsImplicitConstructor) ||
1398method.ContainingType,
1425method.ContainingType,
1443method.ContainingType,
2339Debug.Assert(!method.ContainingType.IsDelegateType());
2364if (ctorCall != null && !ctorCall.HasAnyErrors && ctorCall.Method != method && TypeSymbol.Equals(ctorCall.Method.ContainingType, method.ContainingType, TypeCompareKind.ConsiderEverything2))
FlowAnalysis\NullableWalker.cs (32)
650? method.ContainingType.GetMembersUnordered().SelectManyAsArray(
660foreach (var member in method.ContainingType.GetMembersUnordered())
675if (chainedConstructorEnforcesRequiredMembers && !constructorEnforcesRequiredMembers && method.ContainingType.BaseTypeNoUseSiteDiagnostics is { } baseType)
895&& (!method.ContainingType.IsValueType
899return membersToBeInitialized(method.ContainingType, includeAllMembers: true, includeCurrentTypeRequiredMembers, includeBaseRequiredMembers);
904return membersToBeInitialized(method.ContainingType, includeAllMembers: method.IncludeFieldInitializersInBody(), includeCurrentTypeRequiredMembers, includeBaseRequiredMembers);
1000foreach (var member in property.ContainingType.GetMembers(notNullMemberName))
1043foreach (var member in method.ContainingType.GetMembers(memberName))
1079enforceMemberNotNullWhenIfAffected(returnStatement.Syntax, sense: true, members: method.ContainingType.GetMembers(memberName), state: pendingReturn.StateWhenTrue, otherState: pendingReturn.StateWhenFalse);
1084enforceMemberNotNullWhenIfAffected(returnStatement.Syntax, sense: false, members: method.ContainingType.GetMembers(memberName), state: pendingReturn.StateWhenFalse, otherState: pendingReturn.StateWhenTrue);
1110foreach (var member in method.ContainingType.GetMembers(memberName))
1163var type = method.ContainingType;
1470&& method.ContainingType is SourceMemberContainerTypeSymbol containingType)
2214if ((constructor.IsStatic && containingSlot == 0 && constructor.ContainingType.Equals(symbol.ContainingType))
2674TypeSymbol possibleBase = possibleMember.ContainingType;
3666(FieldSymbol { ContainingType: { IsTupleType: true }, TupleElementIndex: var oi } originalField, FieldSymbol { ContainingType: { IsTupleType: true }, TupleElementIndex: var ui } updatedField) =>
4040var containingType = constructor?.ContainingType;
5159TypeSymbol methodContainer = method.ContainingType;
5544var containingType = this._symbol?.ContainingType;
6430var wellKnownType = wellKnownMethod.ContainingType;
6451if (implementationMethod.ContainingType.IsInterface)
6482while (!baseType.Equals(implementationMethod.ContainingType) && method is object)
6484if (baseType.Equals(method.ContainingType))
6498if (method is object && baseType.Equals(method.ContainingType))
6618method.ContainingType.IsReferenceType)
7215var type = method.ContainingType;
7928definition.ContainingType,
8264var symbolContainer = symbol.ContainingType;
8276Debug.Assert(symbol.ContainingType.IsDefinition);
10880if ((object)getMethod != null && getMethod.ContainingType.SpecialType == SpecialType.System_Nullable_T)
Lowering\DiagnosticsPass_ExpressionTrees.cs (2)
278Binder.ReportDiagnosticsIfObsolete(_diagnostics, node.EventSymbol.AssociatedField, node.Syntax, hasBaseReceiver, _containingSymbol, _containingSymbol.ContainingType, BinderFlags.None);
292Binder.ReportDiagnosticsIfObsolete(_diagnostics, node.Event, ((AssignmentExpressionSyntax)node.Syntax).Left, hasBaseReceiver, _containingSymbol, _containingSymbol.ContainingType, BinderFlags.None);
Lowering\SyntheticBoundNodeFactory.cs (9)
76_currentType = value.ContainingType;
104: this(topLevelMethod, topLevelMethod.ContainingType, node, compilationState, diagnostics, instrumentationState)
134Debug.Assert(TopLevelMethod is null || TypeSymbol.Equals(TopLevelMethod.ContainingType, CurrentType, TypeCompareKind.ConsiderEverything2));
143TypeSymbol.Equals(CurrentFunction.ContainingType, CurrentType, TypeCompareKind.ConsiderEverything2));
769constructor.ContainingType)
1310GetMethodFromHandleMethod(ctor.ContainingType, constructorInfo),
1409if (!method.ContainingType.IsValueType || !Microsoft.CodeAnalysis.CSharp.CodeGen.CodeGenerator.MayUseCallForStructMethod(method))
1417GetMethodFromHandleMethod(method.ContainingType, systemReflectionMethodInfo),
1433GetFieldFromHandleMethod(field.ContainingType),