Binder\Binder_Expressions.cs (13)
51var containingType = memberOpt?.ContainingType;
1476var implicitReceiver = field.IsStatic ? null : ThisReference(node, field.ContainingType, wasCompilerGenerated: true);
2260NamedTypeSymbol declaringType = member.ContainingType;
4776NamedTypeSymbol containingType = constructor.ContainingType;
4936NamedTypeSymbol baseType = constructor.ContainingType.BaseTypeNoUseSiteDiagnostics;
5061if (resultMember is null || resultMember.ContainingType.SpecialType != SpecialType.System_Object)
5108return constructor.ContainingType is SourceNamedTypeSymbol sourceType &&
6085constructor.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.
6090return constructor.ContainingType.AllRequiredMembers;
6604this.IsSymbolAccessibleConditional(constructor, containingType, ref useSiteInfo, constructor.ContainingType);
8521NamedTypeSymbol type = fieldSymbol.ContainingType;
8694if (symbol.ContainingType?.IsInterface == true)
10219return 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());
276new TypeCompilationState(synthesizedEntryPoint.ContainingType, compilation, moduleBeingBuilt),
831if (!interfaces.Contains(synthesizedExplicitImpl.ExplicitInterfaceImplementations[0].ContainingType,
895if (methodSymbol.IsAbstract || methodSymbol.ContainingType?.IsDelegateType() == true)
1021Debug.Assert(!prependedDefaultValueTypeConstructorInitializer || methodSymbol.ContainingType.IsStructType());
1035((methodSymbol.ContainingType.IsStructType() && !methodSymbol.IsImplicitConstructor) ||
1394method.ContainingType,
1421method.ContainingType,
1439method.ContainingType,
2335Debug.Assert(!method.ContainingType.IsDelegateType());
2360if (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;
1468&& method.ContainingType is SourceMemberContainerTypeSymbol containingType)
2212if ((constructor.IsStatic && containingSlot == 0 && constructor.ContainingType.Equals(symbol.ContainingType))
2672TypeSymbol possibleBase = possibleMember.ContainingType;
3664(FieldSymbol { ContainingType: { IsTupleType: true }, TupleElementIndex: var oi } originalField, FieldSymbol { ContainingType: { IsTupleType: true }, TupleElementIndex: var ui } updatedField) =>
4037var containingType = constructor?.ContainingType;
5154TypeSymbol methodContainer = method.ContainingType;
5539var containingType = this._symbol?.ContainingType;
6425var wellKnownType = wellKnownMethod.ContainingType;
6446if (implementationMethod.ContainingType.IsInterface)
6477while (!baseType.Equals(implementationMethod.ContainingType) && method is object)
6479if (baseType.Equals(method.ContainingType))
6493if (method is object && baseType.Equals(method.ContainingType))
6613method.ContainingType.IsReferenceType)
7204var type = method.ContainingType;
7917definition.ContainingType,
8253var symbolContainer = symbol.ContainingType;
8265Debug.Assert(symbol.ContainingType.IsDefinition);
10869if ((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));
761constructor.ContainingType)
1302GetMethodFromHandleMethod(ctor.ContainingType, constructorInfo),
1401if (!method.ContainingType.IsValueType || !Microsoft.CodeAnalysis.CSharp.CodeGen.CodeGenerator.MayUseCallForStructMethod(method))
1409GetMethodFromHandleMethod(method.ContainingType, systemReflectionMethodInfo),
1425GetFieldFromHandleMethod(field.ContainingType),