1 instantiation of SynthesizedPrimaryConstructor
Microsoft.CodeAnalysis.CSharp (1)
Symbols\Source\SourceMemberContainerSymbol.cs (1)
3992var 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)
1160parameterSymbol.ContainingSymbol is SynthesizedPrimaryConstructor primaryConstructor &&
Binder\Binder_Expressions.cs (7)
1770ContainingType is SourceMemberContainerTypeSymbol { IsRecord: false, IsRecordStruct: false, PrimaryConstructor: SynthesizedPrimaryConstructor { ParameterCount: not 0 } primaryConstructor, OriginalDefinition: var containingTypeDefinition } && 2117var primaryCtor = parameter.ContainingSymbol as SynthesizedPrimaryConstructor; 2267private bool IsInDeclaringTypeInstanceMember(SynthesizedPrimaryConstructor primaryCtor) 5035if (constructor is SynthesizedPrimaryConstructor primaryConstructor) 5141private static (ParameterSymbol, SyntaxNode) TryGetPrimaryConstructorParameterUsedAsValue(SynthesizedPrimaryConstructor primaryConstructor, BoundExpression boundExpression) 5172constructor is not SynthesizedPrimaryConstructor &&
Binder\Binder_Operators.cs (1)
4076if (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)
5183var primaryConstructor = TryGetSynthesizedPrimaryConstructor( 5240protected 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) 2485case TypeDeclarationSyntax typeDeclaration when TryGetSynthesizedPrimaryConstructor(typeDeclaration) is SynthesizedPrimaryConstructor ctor: 2552when typeDeclaration.PrimaryConstructorBaseTypeIfClass == declaredNode && TryGetSynthesizedPrimaryConstructor(typeDeclaration) is SynthesizedPrimaryConstructor ctor:
Compiler\MethodCompiler.cs (3)
1066methodSymbol is SynthesizedPrimaryConstructor || 1256if (methodSymbol is SynthesizedPrimaryConstructor primaryCtor) 1746isPrimaryConstructor: 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): 690!(captured is ParameterSymbol { ContainingSymbol: SynthesizedPrimaryConstructor primaryConstructor } parameter && 747if (symbol is ParameterSymbol { ContainingSymbol: SynthesizedPrimaryConstructor } parameter) 1958if (!parameter.IsThis && parameter.RefKind != RefKind.Out && parameter.ContainingSymbol is SynthesizedPrimaryConstructor primaryCtor)
FlowAnalysis\NullableWalker.cs (4)
662var exitLocation = method is SynthesizedPrimaryConstructor || method.DeclaringSyntaxReferences.IsEmpty ? null : method.TryGetFirstLocation(); 2229if (symbol is ParameterSymbol { ContainingSymbol: SynthesizedPrimaryConstructor primaryConstructor } parameter && 2946if (methodSymbol is SynthesizedPrimaryConstructor) 10622parameter.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)
111Debug.Assert(!allVariables.Any((s, method) => s.Symbol is ParameterSymbol { ContainingSymbol: var container } && container != method && container is not SynthesizedPrimaryConstructor, method));
Symbols\Source\SourceMemberContainerSymbol.cs (14)
1055internal readonly SynthesizedPrimaryConstructor? PrimaryConstructor; 1064SynthesizedPrimaryConstructor? primaryConstructor, 3211public SynthesizedPrimaryConstructor? PrimaryConstructor; 3271public readonly SynthesizedPrimaryConstructor? PrimaryConstructor; 3289SynthesizedPrimaryConstructor? primaryConstructor, 3712internal SynthesizedPrimaryConstructor? PrimaryConstructor 3720SynthesizedPrimaryConstructor? result; 3738SynthesizedPrimaryConstructor? primaryConstructor; 3808SynthesizedPrimaryConstructor? primaryConstructor; 3992var ctor = new SynthesizedPrimaryConstructor(this, syntax); 4810var ctor = declaredMembersAndInitializers.PrimaryConstructor; 4860var ctor = declaredMembersAndInitializers.PrimaryConstructor; 4923void addDeconstruct(SynthesizedPrimaryConstructor ctor, ImmutableArray<Symbol> positionalMembers) 5452!(SynthesizedRecordCopyCtor.HasCopyConstructorSignature(method) && method is not SynthesizedPrimaryConstructor))
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)
102return parameter.ContainingSymbol is SynthesizedPrimaryConstructor &&
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (144)
Semantics\ExtensionTests.cs (5)
14021Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 14063Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 19315Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 19405Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 20187Assert.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()); 6058var constructor = cMember.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single(); 6212var constructor = cMember.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single(); 6294var constructor = cMember.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single(); 6362var cConstructor = c.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single(); 6396var dConstructor = d.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single(); 6437var eConstructor = e.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single(); 6472var eConstructor = e.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single(); 6511var cConstructor = c.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single(); 6544var dConstructor = d.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single(); 6589var eConstructor = e.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single(); 6633var eConstructor = e.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single(); 6673var eConstructor = e.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single(); 6709var constructor = cMember.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single(); 6763var constructor = cMember.GetMembers(".ctor").OfType<SynthesizedPrimaryConstructor>().Single(); 7838var capturedParameters = comp.GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters(); 8703Assert.Empty(((CSharpCompilation)verifier.Compilation).GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 9886Assert.Empty(comp.GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 9946Assert.Equal(1, comp.GetTypeByMetadataName("C2").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Count); 9947Assert.Empty(comp.GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 9999Assert.Empty(comp.GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10000Assert.Equal(1, comp.GetTypeByMetadataName("C2").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Count); 10001Assert.Equal(1, comp.GetTypeByMetadataName("C3").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Count); 10002Assert.Equal(2, comp.GetTypeByMetadataName("C4").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Count); 10021Assert.Equal(1, comp.GetTypeByMetadataName("C3").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Count); 10048Assert.Equal(2, comp.GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Count); 10150Assert.Equal(1, comp.GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Count); 10193Assert.Empty(comp.GetTypeByMetadataName("Color+C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10228Assert.Empty(comp.GetTypeByMetadataName("Color+C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10271Assert.Empty(comp.GetTypeByMetadataName("Color+C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10309Assert.NotEmpty(comp.GetTypeByMetadataName("Color+C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10340Assert.NotEmpty(comp.GetTypeByMetadataName("Color+C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10380Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10416Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10452Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10491Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10530Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10566Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10602Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10641Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10680Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10719Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10755Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10791Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10831Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10878Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10922Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10962Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11005Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11052Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11094Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11139Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11174Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11204Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11239Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11269Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11304Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11335Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11371Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11402Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11445Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11484Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11523Assert.Empty(comp.GetTypeByMetadataName("Color+C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11563Assert.Empty(comp.GetTypeByMetadataName("Color+C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11606Assert.Empty(comp.GetTypeByMetadataName("Color+C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11796Assert.Equal(isStatic, comp.GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().IsEmpty()); 11840Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11841Assert.Empty(comp.GetTypeByMetadataName("S2").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11842Assert.NotEmpty(comp.GetTypeByMetadataName("S3").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11914Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11950Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11993Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 12041Assert.Equal("System.String P1", comp1.GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Single().Key.ToTestDisplayString()); 12042Assert.Equal("System.Int32 p2", comp1.GetTypeByMetadataName("C2").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Single().Key.ToTestDisplayString()); 12043Assert.Equal(2, comp1.GetTypeByMetadataName("C3").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Count); 12073Assert.Empty(comp2.GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 12074Assert.Empty(comp2.GetTypeByMetadataName("C2").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 12114Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 12158Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 12204Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 14620Assert.All(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetBackingFields(), f => Assert.True(f.IsReadOnly)); 14816Assert.All(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetBackingFields(), f => Assert.True(f.IsReadOnly)); 15017Assert.All(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetBackingFields(), f => Assert.True(f.IsReadOnly)); 15243Assert.All(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetBackingFields(), f => Assert.True(f.IsReadOnly)); 15554Assert.All(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetBackingFields(), f => Assert.True(f.IsReadOnly)); 16379Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 19767Assert.Single(comp.GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 20258Assert.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)