1 instantiation of SynthesizedPrimaryConstructor
Microsoft.CodeAnalysis.CSharp (1)
Symbols\Source\SourceMemberContainerSymbol.cs (1)
3938var ctor = new SynthesizedPrimaryConstructor(this, syntax);
206 references to SynthesizedPrimaryConstructor
Microsoft.CodeAnalysis.CSharp (59)
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)
1384parameterSymbol.ContainingSymbol is SynthesizedPrimaryConstructor primaryConstructor &&
Binder\Binder_Expressions.cs (7)
1793ContainingType is SourceMemberContainerTypeSymbol { IsRecord: false, IsRecordStruct: false, PrimaryConstructor: SynthesizedPrimaryConstructor { ParameterCount: not 0 } primaryConstructor, OriginalDefinition: var containingTypeDefinition } && 2140var primaryCtor = parameter.ContainingSymbol as SynthesizedPrimaryConstructor; 2290private bool IsInDeclaringTypeInstanceMember(SynthesizedPrimaryConstructor primaryCtor) 5058if (constructor is SynthesizedPrimaryConstructor primaryConstructor) 5165private static (ParameterSymbol, SyntaxNode) TryGetPrimaryConstructorParameterUsedAsValue(SynthesizedPrimaryConstructor primaryConstructor, BoundExpression boundExpression) 5196constructor is not SynthesizedPrimaryConstructor &&
Binder\Binder_Operators.cs (1)
4108if (parameterSymbol.ContainingSymbol is SynthesizedPrimaryConstructor primaryConstructor &&
Binder\Binder_Symbols.cs (1)
1526if (colorColorValueReceiver is BoundParameter { ParameterSymbol: { ContainingSymbol: SynthesizedPrimaryConstructor primaryConstructor } parameter } &&
Binder\BinderFactory.BinderFactoryVisitor.cs (1)
1263var primaryConstructor = type.PrimaryConstructor;
Binder\BinderFactory.cs (1)
155internal InMethodBinder GetPrimaryConstructorInMethodBinder(SynthesizedPrimaryConstructor constructor)
Compilation\CSharpSemanticModel.cs (2)
5203var primaryConstructor = TryGetSynthesizedPrimaryConstructor( 5260protected static SynthesizedPrimaryConstructor TryGetSynthesizedPrimaryConstructor(TypeDeclarationSyntax node, NamedTypeSymbol type)
Compilation\MethodBodySemanticModel.cs (1)
259if (MemberSymbol is SynthesizedPrimaryConstructor primaryCtor &&
Compilation\SyntaxTreeSemanticModel.cs (5)
184case TypeDeclarationSyntax { ParameterList: { }, PrimaryConstructorBaseTypeIfClass: { } } typeDeclaration when TryGetSynthesizedPrimaryConstructor(typeDeclaration) is SynthesizedPrimaryConstructor: 1093SynthesizedPrimaryConstructor symbol = TryGetSynthesizedPrimaryConstructor((TypeDeclarationSyntax)node); 1254private SynthesizedPrimaryConstructor TryGetSynthesizedPrimaryConstructor(TypeDeclarationSyntax node) 2497case TypeDeclarationSyntax typeDeclaration when TryGetSynthesizedPrimaryConstructor(typeDeclaration) is SynthesizedPrimaryConstructor ctor: 2564when typeDeclaration.PrimaryConstructorBaseTypeIfClass == declaredNode && TryGetSynthesizedPrimaryConstructor(typeDeclaration) is SynthesizedPrimaryConstructor ctor:
Compiler\MethodCompiler.cs (3)
1081methodSymbol is SynthesizedPrimaryConstructor || 1270if (methodSymbol is SynthesizedPrimaryConstructor primaryCtor) 1777isPrimaryConstructor: 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)
342(not SynthesizedPrimaryConstructor): 641!(captured is ParameterSymbol { ContainingSymbol: SynthesizedPrimaryConstructor primaryConstructor } parameter && 698if (symbol is ParameterSymbol { ContainingSymbol: SynthesizedPrimaryConstructor } parameter) 1909if (!parameter.IsThis && parameter.RefKind != RefKind.Out && parameter.ContainingSymbol is SynthesizedPrimaryConstructor primaryCtor)
FlowAnalysis\NullableWalker.cs (4)
679var exitLocation = method is SynthesizedPrimaryConstructor || method.DeclaringSyntaxReferences.IsEmpty ? null : method.TryGetFirstLocation(); 2247if (symbol is ParameterSymbol { ContainingSymbol: SynthesizedPrimaryConstructor primaryConstructor } parameter && 2964if (methodSymbol is SynthesizedPrimaryConstructor) 10761parameter.ContainingSymbol is not SynthesizedPrimaryConstructor primaryConstructor || !primaryConstructor.GetCapturedParameters().ContainsKey(parameter):
FlowAnalysis\ReadWriteWalker.cs (1)
95Debug.Assert(!ignoreThisParameter || m is SynthesizedPrimaryConstructor);
Lowering\ClosureConversion\ClosureConversion.cs (2)
804_currentMethod is not SynthesizedPrimaryConstructor) 814Debug.Assert(_currentMethod is not SynthesizedPrimaryConstructor primaryConstructor ||
Lowering\LocalRewriter\LocalRewriter.cs (1)
314if (node.ParameterSymbol.ContainingSymbol is SynthesizedPrimaryConstructor primaryCtor &&
Lowering\LocalRewriter\LocalRewriter_Call.cs (1)
641return expression is BoundParameter { ParameterSymbol: { ContainingSymbol: SynthesizedPrimaryConstructor primaryCtor } parameter } &&
Lowering\StateMachineRewriter\IteratorAndAsyncCaptureWalker.cs (1)
118Debug.Assert(!allVariables.Any((s, method) => s.Symbol is ParameterSymbol { ContainingSymbol: var container } && container != method && container is not SynthesizedPrimaryConstructor, method));
Symbols\Source\SourceMemberContainerSymbol.cs (14)
1068internal readonly SynthesizedPrimaryConstructor? PrimaryConstructor; 1077SynthesizedPrimaryConstructor? primaryConstructor, 3175public SynthesizedPrimaryConstructor? PrimaryConstructor; 3235public readonly SynthesizedPrimaryConstructor? PrimaryConstructor; 3253SynthesizedPrimaryConstructor? primaryConstructor, 3676internal SynthesizedPrimaryConstructor? PrimaryConstructor 3684SynthesizedPrimaryConstructor? result; 3702SynthesizedPrimaryConstructor? primaryConstructor; 3772SynthesizedPrimaryConstructor? primaryConstructor; 3938var ctor = new SynthesizedPrimaryConstructor(this, syntax); 4756var ctor = declaredMembersAndInitializers.PrimaryConstructor; 4806var ctor = declaredMembersAndInitializers.PrimaryConstructor; 4869void addDeconstruct(SynthesizedPrimaryConstructor ctor, ImmutableArray<Symbol> positionalMembers) 5398!(SynthesizedRecordCopyCtor.HasCopyConstructorSignature(method) && method is not SynthesizedPrimaryConstructor))
Symbols\Source\SourceMemberMethodSymbol.cs (1)
925if (this is SynthesizedPrimaryConstructor primaryConstructor)
Symbols\Synthesized\Records\SynthesizedRecordDeconstruct.cs (2)
15private readonly SynthesizedPrimaryConstructor _ctor; 20SynthesizedPrimaryConstructor ctor,
Symbols\Synthesized\Records\SynthesizedRecordPropertySymbol.cs (1)
102return parameter.ContainingSymbol is SynthesizedPrimaryConstructor &&
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (144)
Semantics\ExtensionTests.cs (5)
14990Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 15032Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 20328Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 20418Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 21200Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters());
Semantics\PrimaryConstructorTests.cs (106)
556Assert.IsType<SynthesizedPrimaryConstructor>(ctor); 720if (ctor is SynthesizedPrimaryConstructor) 776Assert.IsType<SynthesizedPrimaryConstructor>(ctor); 823Assert.IsType<SynthesizedPrimaryConstructor>(c.InstanceConstructors[0]); 1979Assert.Empty(((SynthesizedPrimaryConstructor)symbol.GetSymbol().ContainingSymbol).GetCapturedParameters()); 6068var constructor = cMember.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single(); 6222var constructor = cMember.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single(); 6304var constructor = cMember.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single(); 6372var cConstructor = c.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single(); 6406var dConstructor = d.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single(); 6447var eConstructor = e.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single(); 6482var eConstructor = e.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single(); 6521var cConstructor = c.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single(); 6554var dConstructor = d.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single(); 6599var eConstructor = e.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single(); 6643var eConstructor = e.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single(); 6683var eConstructor = e.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single(); 6719var constructor = cMember.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single(); 6773var constructor = cMember.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single(); 7848var capturedParameters = comp.GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters(); 8713Assert.Empty(((CSharpCompilation)verifier.Compilation).GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 9896Assert.Empty(comp.GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 9956Assert.Equal(1, comp.GetTypeByMetadataName("C2").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Count); 9957Assert.Empty(comp.GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10009Assert.Empty(comp.GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10010Assert.Equal(1, comp.GetTypeByMetadataName("C2").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Count); 10011Assert.Equal(1, comp.GetTypeByMetadataName("C3").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Count); 10012Assert.Equal(2, comp.GetTypeByMetadataName("C4").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Count); 10031Assert.Equal(1, comp.GetTypeByMetadataName("C3").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Count); 10058Assert.Equal(2, comp.GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Count); 10160Assert.Equal(1, comp.GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Count); 10203Assert.Empty(comp.GetTypeByMetadataName("Color+C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10238Assert.Empty(comp.GetTypeByMetadataName("Color+C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10281Assert.Empty(comp.GetTypeByMetadataName("Color+C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10319Assert.NotEmpty(comp.GetTypeByMetadataName("Color+C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10350Assert.NotEmpty(comp.GetTypeByMetadataName("Color+C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10390Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10426Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10462Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10501Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10540Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10576Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10612Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10651Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10690Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10729Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10765Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10801Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10841Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10888Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10932Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10972Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11015Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11062Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11104Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11149Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11184Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11214Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11249Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11279Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11314Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11345Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11381Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11412Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11455Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11494Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11533Assert.Empty(comp.GetTypeByMetadataName("Color+C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11573Assert.Empty(comp.GetTypeByMetadataName("Color+C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11616Assert.Empty(comp.GetTypeByMetadataName("Color+C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11806Assert.Equal(isStatic, comp.GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().IsEmpty()); 11850Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11851Assert.Empty(comp.GetTypeByMetadataName("S2").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11852Assert.NotEmpty(comp.GetTypeByMetadataName("S3").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11924Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11960Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 12003Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 12051Assert.Equal("System.String P1", comp1.GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Single().Key.ToTestDisplayString()); 12052Assert.Equal("System.Int32 p2", comp1.GetTypeByMetadataName("C2").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Single().Key.ToTestDisplayString()); 12053Assert.Equal(2, comp1.GetTypeByMetadataName("C3").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Count); 12083Assert.Empty(comp2.GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 12084Assert.Empty(comp2.GetTypeByMetadataName("C2").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 12124Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 12168Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 12214Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 14630Assert.All(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetBackingFields(), f => Assert.True(f.IsReadOnly)); 14826Assert.All(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetBackingFields(), f => Assert.True(f.IsReadOnly)); 15027Assert.All(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetBackingFields(), f => Assert.True(f.IsReadOnly)); 15253Assert.All(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetBackingFields(), f => Assert.True(f.IsReadOnly)); 15564Assert.All(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetBackingFields(), f => Assert.True(f.IsReadOnly)); 16389Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 19777Assert.Single(comp.GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 20268Assert.Empty(comp.GetTypeByMetadataName("C").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters());
Semantics\RecordTests.cs (33)
10040var b1Ctor = comp.GetTypeByMetadataName("B1")!.GetMembersUnordered().OfType<SynthesizedPrimaryConstructor>().Single(); 22195Assert.Empty(((SynthesizedPrimaryConstructor)symbol.GetSymbol().ContainingSymbol).GetCapturedParameters()); 28247var constructor = cMember.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single(); 28399var constructor = cMember.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single(); 28538var constructor = cMember.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single(); 28609var constructor = cMember.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single(); 28693var cConstructor = c.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single(); 28740var dConstructor = d.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single(); 28794var eConstructor = e.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single(); 28842var eConstructor = e.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single(); 28893var cConstructor = c.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single(); 28939var dConstructor = d.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single(); 28997var eConstructor = e.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single(); 29055var eConstructor = e.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single(); 29104var eConstructor = e.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single(); 29153var constructor = cMember.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single(); 29222var constructor = cMember.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single();
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (2)
Semantics\RecordStructTests.cs (2)
3278var constructor = cMember.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single();
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Symbols\Source\RecordTests.cs (1)
123if (ctor is SynthesizedPrimaryConstructor)