Describe the bug
toPatched function requires Mutable variant of entity even though it doesn't need it.
It generates next code:
public fun UserEntity.toPatched(patch: UserEntity): UserEntity {
val isMutable = this is MutableUserEntity
val base = if(isMutable) this as MutableUserEntity else this.toMutable()
patch.id?.let{
base.id = it
}
patch.firstName?.let{
base.firstName = it
}
patch.lastName?.let{
base.lastName = it
}
return if(isMutable) this else base.toImmutable()
}
To Reproduce
Steps to reproduce the behavior:
- Create entity with annotation
DtoImpl without using MutableImpl (use ImmutableImpl)
- Run generation
- Try to build the project
- See error
Expected behavior
I think it shouldn't use mutable variant (almost useless) at all or use it only when mutable variant is available (if we don't need producing instances).
Describe the bug
toPatchedfunction requires Mutable variant of entity even though it doesn't need it.It generates next code:
To Reproduce
Steps to reproduce the behavior:
DtoImplwithout usingMutableImpl(useImmutableImpl)Expected behavior
I think it shouldn't use mutable variant (almost useless) at all or use it only when mutable variant is available (if we don't need producing instances).