CollinAlpert / Lombok.NET

.NET adaptation for Java's Lombok using Source Generators.
MIT License
309 stars 16 forks source link

With attribute doesn't respect init #57

Closed ristogod closed 2 weeks ago

ristogod commented 3 weeks ago

Describe the bug If my property uses init; it still generates

To Reproduce

[With]
public partial class MyClass
{
   public string MyProperty { get; init: }
}

Generates

partial class MyClass
{
   public MyClass WithMyProperty(string myProperty)
   {
      this.MyProperty = myProperty;

      return this;
   }
}

Expected behavior

partial class MyClass
{

}

Environment info

.NET version: 8.0 Lombok.NET version: 2.4.0

CollinAlpert commented 2 weeks ago

Thank you for the issue, the fix is available in v2.4.1.