46 references to SynthesizedPrimaryConstructor
Microsoft.CodeAnalysis.CSharp (46)
Binder\Binder.CapturedParametersFinder.cs (3)
19private readonly SynthesizedPrimaryConstructor _primaryConstructor; 23private CapturedParametersFinder(SynthesizedPrimaryConstructor primaryConstructor, HashSet<string> namesToCheck, ArrayBuilder<ParameterSymbol> captured) 30public static IReadOnlyDictionary<ParameterSymbol, FieldSymbol> GetCapturedParameters(SynthesizedPrimaryConstructor primaryConstructor)
Binder\Binder.ValueChecks.cs (1)
1165parameterSymbol.ContainingSymbol is SynthesizedPrimaryConstructor primaryConstructor &&
Binder\Binder_Expressions.cs (7)
1768ContainingType is SourceMemberContainerTypeSymbol { IsRecord: false, IsRecordStruct: false, PrimaryConstructor: SynthesizedPrimaryConstructor { ParameterCount: not 0 } primaryConstructor, OriginalDefinition: var containingTypeDefinition } && 2115var primaryCtor = parameter.ContainingSymbol as SynthesizedPrimaryConstructor; 2265private bool IsInDeclaringTypeInstanceMember(SynthesizedPrimaryConstructor primaryCtor) 5024if (constructor is SynthesizedPrimaryConstructor primaryConstructor) 5130private static (ParameterSymbol, SyntaxNode) TryGetPrimaryConstructorParameterUsedAsValue(SynthesizedPrimaryConstructor primaryConstructor, BoundExpression boundExpression) 5161constructor is not SynthesizedPrimaryConstructor &&
Binder\Binder_Operators.cs (1)
2654if (parameterSymbol.ContainingSymbol is SynthesizedPrimaryConstructor primaryConstructor &&
Binder\Binder_Symbols.cs (1)
1516if (colorColorValueReceiver is BoundParameter { ParameterSymbol: { ContainingSymbol: SynthesizedPrimaryConstructor primaryConstructor } parameter } &&
Binder\BinderFactory.cs (1)
155internal InMethodBinder GetPrimaryConstructorInMethodBinder(SynthesizedPrimaryConstructor constructor)
Compilation\CSharpSemanticModel.cs (2)
5180var primaryConstructor = TryGetSynthesizedPrimaryConstructor( 5237protected static SynthesizedPrimaryConstructor TryGetSynthesizedPrimaryConstructor(TypeDeclarationSyntax node, NamedTypeSymbol type)
Compilation\MethodBodySemanticModel.cs (1)
260if (MemberSymbol is SynthesizedPrimaryConstructor primaryCtor &&
Compilation\SyntaxTreeSemanticModel.cs (5)
184case TypeDeclarationSyntax { ParameterList: { }, PrimaryConstructorBaseTypeIfClass: { } } typeDeclaration when TryGetSynthesizedPrimaryConstructor(typeDeclaration) is SynthesizedPrimaryConstructor: 1096SynthesizedPrimaryConstructor symbol = TryGetSynthesizedPrimaryConstructor((TypeDeclarationSyntax)node); 1257private SynthesizedPrimaryConstructor TryGetSynthesizedPrimaryConstructor(TypeDeclarationSyntax node) 2488case TypeDeclarationSyntax typeDeclaration when TryGetSynthesizedPrimaryConstructor(typeDeclaration) is SynthesizedPrimaryConstructor ctor: 2555when typeDeclaration.PrimaryConstructorBaseTypeIfClass == declaredNode && TryGetSynthesizedPrimaryConstructor(typeDeclaration) is SynthesizedPrimaryConstructor ctor:
Compiler\MethodCompiler.cs (3)
1061methodSymbol is SynthesizedPrimaryConstructor || 1251if (methodSymbol is SynthesizedPrimaryConstructor primaryCtor) 1736isPrimaryConstructor: method is SynthesizedPrimaryConstructor);
FlowAnalysis\DataFlowsOutWalker.cs (1)
234param.ContainingSymbol is SynthesizedPrimaryConstructor); // Primary constructor parameter can be used in other initializers and methods
FlowAnalysis\DefiniteAssignment.cs (4)
341(not SynthesizedPrimaryConstructor): 704!(captured is ParameterSymbol { ContainingSymbol: SynthesizedPrimaryConstructor primaryConstructor } parameter && 761if (symbol is ParameterSymbol { ContainingSymbol: SynthesizedPrimaryConstructor } parameter) 1972if (!parameter.IsThis && parameter.RefKind != RefKind.Out && parameter.ContainingSymbol is SynthesizedPrimaryConstructor primaryCtor)
FlowAnalysis\NullableWalker.cs (4)
652var exitLocation = method is SynthesizedPrimaryConstructor || method.DeclaringSyntaxReferences.IsEmpty ? null : method.TryGetFirstLocation(); 2208if (symbol is ParameterSymbol { ContainingSymbol: SynthesizedPrimaryConstructor primaryConstructor } parameter && 2925if (methodSymbol is SynthesizedPrimaryConstructor) 10269parameter.ContainingSymbol is not SynthesizedPrimaryConstructor primaryConstructor || !primaryConstructor.GetCapturedParameters().ContainsKey(parameter):
FlowAnalysis\ReadWriteWalker.cs (1)
95Debug.Assert(!ignoreThisParameter || m is SynthesizedPrimaryConstructor);
Lowering\ClosureConversion\ClosureConversion.cs (2)
799_currentMethod is not SynthesizedPrimaryConstructor) 809Debug.Assert(_currentMethod is not SynthesizedPrimaryConstructor primaryConstructor ||
Lowering\LocalRewriter\LocalRewriter.cs (1)
314if (node.ParameterSymbol.ContainingSymbol is SynthesizedPrimaryConstructor primaryCtor &&
Lowering\LocalRewriter\LocalRewriter_Call.cs (1)
625return expression is BoundParameter { ParameterSymbol: { ContainingSymbol: SynthesizedPrimaryConstructor primaryCtor } parameter } &&
Lowering\StateMachineRewriter\IteratorAndAsyncCaptureWalker.cs (1)
111Debug.Assert(!allVariables.Any((s, method) => s.Symbol is ParameterSymbol { ContainingSymbol: var container } && container != method && container is not SynthesizedPrimaryConstructor, method));
Symbols\Source\SourceMemberContainerSymbol.cs (2)
1056internal readonly SynthesizedPrimaryConstructor? PrimaryConstructor; 1065SynthesizedPrimaryConstructor? primaryConstructor,
Symbols\Source\SourceMemberMethodSymbol.cs (1)
905if (this is SynthesizedPrimaryConstructor primaryConstructor)
Symbols\Synthesized\Records\SynthesizedRecordDeconstruct.cs (2)
15private readonly SynthesizedPrimaryConstructor _ctor; 20SynthesizedPrimaryConstructor ctor,
Symbols\Synthesized\Records\SynthesizedRecordPropertySymbol.cs (1)
101return parameter.ContainingSymbol is SynthesizedPrimaryConstructor &&