BoundTree\Constructors.cs (3)
61!fieldSymbol.ContainingType.IsValueType ||
203: this(syntax, constructor, ImmutableArray.Create<BoundExpression>(arguments), default(ImmutableArray<string>), default(ImmutableArray<RefKind>), false, default(ImmutableArray<int>), default(BitVector), null, null, constructor.ContainingType)
207: this(syntax, constructor, arguments, default(ImmutableArray<string>), default(ImmutableArray<RefKind>), false, default(ImmutableArray<int>), default(BitVector), null, null, constructor.ContainingType)
Compiler\MethodCompiler.cs (13)
236synthesizedEntryPoint = new SynthesizedEntryPointSymbol.AsyncForwardEntryPoint(compilation, entryPoint.ContainingType, entryPoint);
240moduleBeingBuilt.AddSynthesizedDefinition(entryPoint.ContainingType, synthesizedEntryPoint.GetCciAdapter());
268new TypeCompilationState(synthesizedEntryPoint.ContainingType, compilation, moduleBeingBuilt),
946if (methodSymbol.IsAbstract || methodSymbol.ContainingType?.IsDelegateType() == true)
1070Debug.Assert(!prependedDefaultValueTypeConstructorInitializer || methodSymbol.ContainingType.IsStructType());
1084((methodSymbol.ContainingType.IsStructType() && !methodSymbol.IsImplicitConstructor) ||
1432method.ContainingType,
1459method.ContainingType,
1477method.ContainingType,
1790if (method is SynthesizedPrimaryConstructor primaryCtor && method.ContainingType.IsStructType())
2273Debug.Assert(!method.ContainingType.IsDelegateType());
2298if (ctorCall != null && !ctorCall.HasAnyErrors && ctorCall.Method != method && TypeSymbol.Equals(ctorCall.Method.ContainingType, method.ContainingType, TypeCompareKind.ConsiderEverything2))
FlowAnalysis\NullableWalker.cs (30)
617? method.ContainingType.GetMembersUnordered().SelectManyAsArray(
627foreach (var member in method.ContainingType.GetMembersUnordered())
642if (chainedConstructorEnforcesRequiredMembers && !constructorEnforcesRequiredMembers && method.ContainingType.BaseTypeNoUseSiteDiagnostics is { } baseType)
760foreach (var member in method.ContainingType.GetMembers(memberName))
789enforceMemberNotNullWhenIfAffected(returnStatement.Syntax, sense: true, method.ContainingType.GetMembers(memberName), pendingReturn.StateWhenTrue, pendingReturn.StateWhenFalse);
794enforceMemberNotNullWhenIfAffected(returnStatement.Syntax, sense: false, method.ContainingType.GetMembers(memberName), pendingReturn.StateWhenFalse, pendingReturn.StateWhenTrue);
823foreach (var member in method.ContainingType.GetMembers(memberName))
962&& (!method.ContainingType.IsValueType
966return membersToBeInitialized(method.ContainingType, includeAllMembers: true, includeCurrentTypeRequiredMembers, includeBaseRequiredMembers);
971return membersToBeInitialized(method.ContainingType, includeAllMembers: method.IncludeFieldInitializersInBody(), includeCurrentTypeRequiredMembers, includeBaseRequiredMembers);
1033foreach (var member in property.ContainingType.GetMembers(notNullMemberName))
1057var type = method.ContainingType;
1359&& method.ContainingType is SourceMemberContainerTypeSymbol containingType)
2544TypeSymbol possibleBase = possibleMember.ContainingType;
3391(FieldSymbol { ContainingType: { IsTupleType: true }, TupleElementIndex: var oi } originalField, FieldSymbol { ContainingType: { IsTupleType: true }, TupleElementIndex: var ui } updatedField) =>
3576var containingType = constructor?.ContainingType;
4650TypeSymbol methodContainer = method.ContainingType;
5032var containingType = this._symbol?.ContainingType;
5774var wellKnownType = wellKnownMethod.ContainingType;
5795if (implementationMethod.ContainingType.IsInterface)
5826while (!baseType.Equals(implementationMethod.ContainingType) && method is object)
5828if (baseType.Equals(method.ContainingType))
5842if (method is object && baseType.Equals(method.ContainingType))
5970method.ContainingType.IsReferenceType)
6386var type = method.ContainingType;
7055definition.ContainingType,
7352var symbolContainer = symbol.ContainingType;
7364Debug.Assert(symbol.ContainingType.IsDefinition);
9927if ((object)getMethod != null && getMethod.ContainingType.SpecialType == SpecialType.System_Nullable_T)
Lowering\DiagnosticsPass_ExpressionTrees.cs (2)
267Binder.ReportDiagnosticsIfObsolete(_diagnostics, node.EventSymbol.AssociatedField, node.Syntax, hasBaseReceiver, _containingSymbol, _containingSymbol.ContainingType, BinderFlags.None);
281Binder.ReportDiagnosticsIfObsolete(_diagnostics, node.Event, ((AssignmentExpressionSyntax)node.Syntax).Left, hasBaseReceiver, _containingSymbol, _containingSymbol.ContainingType, BinderFlags.None);
Lowering\SyntheticBoundNodeFactory.cs (8)
74_currentType = value.ContainingType;
151: this(topLevelMethod, topLevelMethod.ContainingType, node, compilationState, diagnostics, instrumentationState)
181Debug.Assert(TopLevelMethod is null || TypeSymbol.Equals(TopLevelMethod.ContainingType, CurrentType, TypeCompareKind.ConsiderEverything2));
190TypeSymbol.Equals(CurrentFunction.ContainingType, CurrentType, TypeCompareKind.ConsiderEverything2));
1221GetMethodFromHandleMethod(ctor.ContainingType),
1308if (!method.ContainingType.IsValueType || !Microsoft.CodeAnalysis.CSharp.CodeGen.CodeGenerator.MayUseCallForStructMethod(method))
1316GetMethodFromHandleMethod(method.ContainingType),
1326GetFieldFromHandleMethod(field.ContainingType),
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ExpressionCompiler.UnitTests (7)