-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
Describe the bug
The [AllArgsConstructor] when instructed to consider Properties, tries to set the computed properties.
To Reproduce
Example of code:
[AllArgsConstructor(MemberType = MemberType.Property, AccessTypes = AccessTypes.Public)]
public partial class ExampleDto
{
public string? Example { get; set; }
public string ComputedProperty => Example ?? "Empty";
}The generated code is:
public partial class ExampleDto
{
public ExampleDto(string? example, string computedProperty)
{
this.Example = example;
this.ComputedProperty = computedProperty;
}
}This results in the error message Property or indexer 'ExampleDto.ComputedProperty' cannot be assigned to -- it is read only
Expected behavior
Constructors should not pick up read-only properties.
Environment info
- .NET version: 6.x
- Lombok.NET version: 2.4.1
Metadata
Metadata
Assignees
Labels
No labels