当前使用版本(必填,否则不予处理)
3.5.4.1
该问题是如何引起的?(确定最新版也有问题再提!!!)
下面的 issue https://github.com/baomidou/mybatis-plus/issues/5454 提出后, Mybatis Plus 把 KProperty<*> 改成了 KMutableProperty1
> KProperty1<in T, *> 这样限定可以传父类可以吗,我第一次 fork 各种问题编译不了
确实可以传父类了
Originally posted by @initchen in https://github.com/baomidou/mybatis-plus/issues/5454#issuecomment-1831177358
重现步骤(如果有就写完整)
interface IUpdateTime {
var updateTime: Instant?
}
interface IUpdater : IUpdateTime {
var updater: Long?
}
data class User(
var id: Long? = null,
override var updater: Long? = null,
override var updateTime: Instant? = null,
): IUpdater
interface ICService<T : Any> : IService<T> {
fun update(whereChain: (KtUpdateChainWrapper<T>) -> KtUpdateChainWrapper<T>): Boolean {
val wrapper = whereChain.invoke(ktUpdate())
val now = Instant.now()
if (IUpdater::class.java.isAssignableFrom(entityClass)) {
wrapper.set(IUpdater::updater, 1L)
wrapper.set(IUpdateTime::updateTime, now)
} else if (IUpdateTime::class.java.isAssignableFrom(entityClass)) {
wrapper.set(IUpdateTime::updateTime, now)
}
return wrapper.update()
}
}
interface ICUpdaterService<T: IUpdater> : ICService<T> {
override fun update(whereChain: (KtUpdateChainWrapper<T>) -> KtUpdateChainWrapper<T>): Boolean {
return super.update{
it.set(IUpdater::updater, 1L)
}
}
}
报错信息
Comment From: c332030
创建了 PR https://github.com/baomidou/mybatis-plus/pull/5829
Comment From: private-static
nice work
Comment From: c332030
nice work
已经发布了,3.5.5