public SynthesizedRecordEqualityContractProperty(NamedTypeSymbol containingType, bool isOverride) { ContainingType = containingType; IsVirtual = !isOverride; IsOverride = isOverride; TypeWithAnnotations = TypeWithAnnotations.Create(containingType.DeclaringCompilation.GetWellKnownType(WellKnownType.System_Type), NullableAnnotation.NotAnnotated); GetMethod = new GetAccessorSymbol(this); }
public SynthesizedRecordEqualityContractProperty(NamedTypeSymbol containingType, bool isOverride) { ContainingType = containingType; IsOverride = isOverride; TypeWithAnnotations = TypeWithAnnotations.Create(containingType.DeclaringCompilation.GetWellKnownType(WellKnownType.System_Type), NullableAnnotation.NotAnnotated); var overriddenProperty = OverriddenProperty; if (overriddenProperty is object) { TypeWithAnnotations = overriddenProperty.TypeWithAnnotations; } var getAccessorName = overriddenProperty?.GetMethod?.Name ?? SourcePropertyAccessorSymbol.GetAccessorName(PropertyName, getNotSet: true, isWinMdOutput: false /* unused for getters */); GetMethod = new GetAccessorSymbol(this, getAccessorName); }
public SynthesizedRecordPropertySymbol( NamedTypeSymbol containingType, ParameterSymbol backingParameter, DiagnosticBag diagnostics) : base(backingParameter.Locations[0]) { ContainingType = containingType; _backingParameter = backingParameter; string name = backingParameter.Name; BackingField = new SynthesizedBackingFieldSymbol( this, GeneratedNames.MakeBackingFieldName(name), isReadOnly: true, isStatic: false, hasInitializer: true); GetMethod = new GetAccessorSymbol(this, name); SetMethod = new InitAccessorSymbol(this, name, diagnostics); }