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);
8523NamedTypeSymbol type = fieldSymbol.ContainingType;
8696if (symbol.ContainingType?.IsInterface == true)
10221return 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)
649? method.ContainingType.GetMembersUnordered().SelectManyAsArray(
659foreach (var member in method.ContainingType.GetMembersUnordered())
674if (chainedConstructorEnforcesRequiredMembers && !constructorEnforcesRequiredMembers && method.ContainingType.BaseTypeNoUseSiteDiagnostics is { } baseType)
894&& (!method.ContainingType.IsValueType
898return membersToBeInitialized(method.ContainingType, includeAllMembers: true, includeCurrentTypeRequiredMembers, includeBaseRequiredMembers);
903return membersToBeInitialized(method.ContainingType, includeAllMembers: method.IncludeFieldInitializersInBody(), includeCurrentTypeRequiredMembers, includeBaseRequiredMembers);
965foreach (var member in property.ContainingType.GetMembers(notNullMemberName))
982foreach (var member in method.ContainingType.GetMembers(memberName))
1018enforceMemberNotNullWhenIfAffected(returnStatement.Syntax, sense: true, members: method.ContainingType.GetMembers(memberName), state: pendingReturn.StateWhenTrue, otherState: pendingReturn.StateWhenFalse);
1023enforceMemberNotNullWhenIfAffected(returnStatement.Syntax, sense: false, members: method.ContainingType.GetMembers(memberName), state: pendingReturn.StateWhenFalse, otherState: pendingReturn.StateWhenTrue);
1049foreach (var member in method.ContainingType.GetMembers(memberName))
1102var type = method.ContainingType;
1407&& method.ContainingType is SourceMemberContainerTypeSymbol containingType)
2151if ((constructor.IsStatic && containingSlot == 0 && constructor.ContainingType.Equals(symbol.ContainingType))
2611TypeSymbol possibleBase = possibleMember.ContainingType;
3603(FieldSymbol { ContainingType: { IsTupleType: true }, TupleElementIndex: var oi } originalField, FieldSymbol { ContainingType: { IsTupleType: true }, TupleElementIndex: var ui } updatedField) =>
3976var containingType = constructor?.ContainingType;
5093TypeSymbol methodContainer = method.ContainingType;
5478var containingType = this._symbol?.ContainingType;
6364var wellKnownType = wellKnownMethod.ContainingType;
6385if (implementationMethod.ContainingType.IsInterface)
6416while (!baseType.Equals(implementationMethod.ContainingType) && method is object)
6418if (baseType.Equals(method.ContainingType))
6432if (method is object && baseType.Equals(method.ContainingType))
6552method.ContainingType.IsReferenceType)
7143var type = method.ContainingType;
7856definition.ContainingType,
8192var symbolContainer = symbol.ContainingType;
8204Debug.Assert(symbol.ContainingType.IsDefinition);
10808if ((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),