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
Hi, we use Immutables and love it, but recently ran into what feels like a bug.
We declare some properties on mixin interfaces so they can be shared among related types, and use from(otherImpl) liberally to copy all relevant properties between the different sub-types. In some cases, we parameterize the types Mixin<Self extends Mixin<Self>> in order to give proper return types to Self withProperty() methods.
However, this seems to break the from() method in some cases. Consider:
Expected:
Since both ImplA and ImplB extend LastModified, and while the parameterization of the type is different, it does not affect the property in any way, I would expect the from method to copy the property.
Actual:
The generated ImmutableImplBBuilder.from method unfortunately seems to not be correct.
Since ImplB already implements Property, the two instanceof clauses are redundant. The second check should probably check for object instanceof LastModified.
The text was updated successfully, but these errors were encountered:
Hi, we use Immutables and love it, but recently ran into what feels like a bug.
We declare some properties on mixin interfaces so they can be shared among related types, and use
from(otherImpl)
liberally to copy all relevant properties between the different sub-types. In some cases, we parameterize the typesMixin<Self extends Mixin<Self>>
in order to give proper return types toSelf withProperty()
methods.However, this seems to break the
from()
method in some cases. Consider:Expected:
Since both
ImplA
andImplB
extendLastModified
, and while the parameterization of the type is different, it does not affect the property in any way, I would expect thefrom
method to copy the property.Actual:
The generated
ImmutableImplBBuilder.from
method unfortunately seems to not be correct.Since ImplB already implements Property, the two
instanceof
clauses are redundant. The second check should probably check forobject instanceof LastModified
.The text was updated successfully, but these errors were encountered: