You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The @accessors doesn't support inherted class well. It can't return the subclass type when calling a setter of superclass on a subclass instance.
I can't do such things: new Child().id(1).name("name"); because the definition of the id setter actually is: public Parent id(int id).
Expected behavior
I hope the usage like new Child().id(1).name("name"); can work. I think that we can use covarient type to override the chain-setters in subclasses just like public Child id(int id).
Version info (please complete the following information):
Lombok version: 1.18.22
Platform: jdk1.8
Thanks,
Geo
The text was updated successfully, but these errors were encountered:
Either you need resolution to find out which methods to override in a subclass, or some sophisticated concept of a SELF type that you can use as return type for the chainable setter methods. Both do not exist in Lombok and will probably not in the foreseeable future.
Describe the bug
The @accessors doesn't support inherted class well. It can't return the subclass type when calling a setter of superclass on a subclass instance.
To Reproduce
For example, there are two classes:
I can't do such things:
new Child().id(1).name("name");
because the definition of the id setter actually is:public Parent id(int id)
.Expected behavior
I hope the usage like
new Child().id(1).name("name");
can work. I think that we can use covarient type to override the chain-setters in subclasses just likepublic Child id(int id)
.Version info (please complete the following information):
Thanks,
Geo
The text was updated successfully, but these errors were encountered: