1 instantiation of SynthesizedPrimaryConstructor
Microsoft.CodeAnalysis.CSharp (1)
Symbols\Source\SourceMemberContainerSymbol.cs (1)
4103
var ctor = new
SynthesizedPrimaryConstructor
(this, syntax);
59 references to SynthesizedPrimaryConstructor
Microsoft.CodeAnalysis.CSharp (59)
Binder\Binder.CapturedParametersFinder.cs (3)
19
private readonly
SynthesizedPrimaryConstructor
_primaryConstructor;
23
private CapturedParametersFinder(
SynthesizedPrimaryConstructor
primaryConstructor, HashSet<string> namesToCheck, ArrayBuilder<ParameterSymbol> captured)
30
public static IReadOnlyDictionary<ParameterSymbol, FieldSymbol> GetCapturedParameters(
SynthesizedPrimaryConstructor
primaryConstructor)
Binder\Binder.ValueChecks.cs (1)
1432
parameterSymbol.ContainingSymbol is
SynthesizedPrimaryConstructor
primaryConstructor &&
Binder\Binder_Expressions.cs (7)
1837
ContainingType is SourceMemberContainerTypeSymbol { IsRecord: false, IsRecordStruct: false, PrimaryConstructor:
SynthesizedPrimaryConstructor
{ ParameterCount: not 0 } primaryConstructor, OriginalDefinition: var containingTypeDefinition } &&
2083
var
primaryCtor = parameter.ContainingSymbol as
SynthesizedPrimaryConstructor
;
2341
private bool IsInDeclaringTypeInstanceMember(
SynthesizedPrimaryConstructor
primaryCtor)
5114
if (constructor is
SynthesizedPrimaryConstructor
primaryConstructor)
5222
private static (ParameterSymbol, SyntaxNode) TryGetPrimaryConstructorParameterUsedAsValue(
SynthesizedPrimaryConstructor
primaryConstructor, BoundExpression boundExpression)
5253
constructor is not
SynthesizedPrimaryConstructor
&&
Binder\Binder_Operators.cs (1)
4272
if (parameterSymbol.ContainingSymbol is
SynthesizedPrimaryConstructor
primaryConstructor &&
Binder\Binder_Symbols.cs (1)
1541
if (colorColorValueSymbol is ParameterSymbol { ContainingSymbol:
SynthesizedPrimaryConstructor
primaryConstructor } parameter &&
Binder\BinderFactory.BinderFactoryVisitor.cs (1)
1277
var
primaryConstructor = type.PrimaryConstructor;
Binder\BinderFactory.cs (1)
155
internal InMethodBinder GetPrimaryConstructorInMethodBinder(
SynthesizedPrimaryConstructor
constructor)
Compilation\CSharpSemanticModel.cs (2)
5240
var
primaryConstructor = TryGetSynthesizedPrimaryConstructor(
5297
protected static
SynthesizedPrimaryConstructor
TryGetSynthesizedPrimaryConstructor(TypeDeclarationSyntax node, NamedTypeSymbol type)
Compilation\MethodBodySemanticModel.cs (1)
259
if (MemberSymbol is
SynthesizedPrimaryConstructor
primaryCtor &&
Compilation\SyntaxTreeSemanticModel.cs (5)
184
case TypeDeclarationSyntax { ParameterList: { }, PrimaryConstructorBaseTypeIfClass: { } } typeDeclaration when TryGetSynthesizedPrimaryConstructor(typeDeclaration) is
SynthesizedPrimaryConstructor
:
1093
SynthesizedPrimaryConstructor
symbol = TryGetSynthesizedPrimaryConstructor((TypeDeclarationSyntax)node);
1254
private
SynthesizedPrimaryConstructor
TryGetSynthesizedPrimaryConstructor(TypeDeclarationSyntax node)
2498
case TypeDeclarationSyntax typeDeclaration when TryGetSynthesizedPrimaryConstructor(typeDeclaration) is
SynthesizedPrimaryConstructor
ctor:
2565
when typeDeclaration.PrimaryConstructorBaseTypeIfClass == declaredNode && TryGetSynthesizedPrimaryConstructor(typeDeclaration) is
SynthesizedPrimaryConstructor
ctor:
Compiler\MethodCompiler.cs (3)
1088
methodSymbol is
SynthesizedPrimaryConstructor
||
1277
if (methodSymbol is
SynthesizedPrimaryConstructor
primaryCtor)
1791
isPrimaryConstructor: method is
SynthesizedPrimaryConstructor
);
FlowAnalysis\DataFlowsOutWalker.cs (1)
234
param.ContainingSymbol is
SynthesizedPrimaryConstructor
); // Primary constructor parameter can be used in other initializers and methods
FlowAnalysis\DefiniteAssignment.cs (4)
342
(not
SynthesizedPrimaryConstructor
):
641
!(captured is ParameterSymbol { ContainingSymbol:
SynthesizedPrimaryConstructor
primaryConstructor } parameter &&
698
if (symbol is ParameterSymbol { ContainingSymbol:
SynthesizedPrimaryConstructor
} parameter)
1910
if (!parameter.IsThis && parameter.RefKind != RefKind.Out && parameter.ContainingSymbol is
SynthesizedPrimaryConstructor
primaryCtor)
FlowAnalysis\NullableWalker.cs (4)
697
var exitLocation = method is
SynthesizedPrimaryConstructor
|| method.DeclaringSyntaxReferences.IsEmpty ? null : method.TryGetFirstLocation();
2284
if (symbol is ParameterSymbol { ContainingSymbol:
SynthesizedPrimaryConstructor
primaryConstructor } parameter &&
3002
if (methodSymbol is
SynthesizedPrimaryConstructor
)
11376
parameter.ContainingSymbol is not
SynthesizedPrimaryConstructor
primaryConstructor || !primaryConstructor.GetCapturedParameters().ContainsKey(parameter):
FlowAnalysis\ReadWriteWalker.cs (1)
95
Debug.Assert(!ignoreThisParameter || m is
SynthesizedPrimaryConstructor
);
Lowering\ClosureConversion\ClosureConversion.cs (2)
814
_currentMethod is not
SynthesizedPrimaryConstructor
)
824
Debug.Assert(_currentMethod is not
SynthesizedPrimaryConstructor
primaryConstructor ||
Lowering\LocalRewriter\LocalRewriter.cs (1)
319
if (node.ParameterSymbol.ContainingSymbol is
SynthesizedPrimaryConstructor
primaryCtor &&
Lowering\LocalRewriter\LocalRewriter_Call.cs (1)
645
return expression is BoundParameter { ParameterSymbol: { ContainingSymbol:
SynthesizedPrimaryConstructor
primaryCtor } parameter } &&
Lowering\StateMachineRewriter\IteratorAndAsyncCaptureWalker.cs (1)
118
Debug.Assert(!allVariables.Any((s, method) => s.Symbol is ParameterSymbol { ContainingSymbol: var container } && container != method && container is not
SynthesizedPrimaryConstructor
, method));
Symbols\Source\SourceMemberContainerSymbol.cs (14)
1163
internal readonly
SynthesizedPrimaryConstructor
? PrimaryConstructor;
1172
SynthesizedPrimaryConstructor
? primaryConstructor,
3313
public
SynthesizedPrimaryConstructor
? PrimaryConstructor;
3373
public readonly
SynthesizedPrimaryConstructor
? PrimaryConstructor;
3391
SynthesizedPrimaryConstructor
? primaryConstructor,
3829
internal
SynthesizedPrimaryConstructor
? PrimaryConstructor
3837
SynthesizedPrimaryConstructor
? result;
3855
SynthesizedPrimaryConstructor
? primaryConstructor;
3929
SynthesizedPrimaryConstructor
? primaryConstructor;
4103
var
ctor = new SynthesizedPrimaryConstructor(this, syntax);
4928
var
ctor = declaredMembersAndInitializers.PrimaryConstructor;
5070
var
ctor = declaredMembersAndInitializers.PrimaryConstructor;
5133
void addDeconstruct(
SynthesizedPrimaryConstructor
ctor, ImmutableArray<Symbol> positionalMembers)
5662
!(SynthesizedRecordCopyCtor.HasCopyConstructorSignature(method) && method is not
SynthesizedPrimaryConstructor
))
Symbols\Source\SourceMemberMethodSymbol.cs (1)
930
if (this is
SynthesizedPrimaryConstructor
primaryConstructor)
Symbols\Synthesized\Records\SynthesizedRecordDeconstruct.cs (2)
15
private readonly
SynthesizedPrimaryConstructor
_ctor;
20
SynthesizedPrimaryConstructor
ctor,
Symbols\Synthesized\Records\SynthesizedRecordPropertySymbol.cs (1)
104
return parameter.ContainingSymbol is
SynthesizedPrimaryConstructor
&&