Closed joc-a closed 4 months ago
@joc-a Could you please confirm that this doesn't reintroduce any of the highlighted compiler warning issues detailed in PR #1961 and #1984 ? There are no tests for these warnings, just have to confirm with examples in the IDE and maybe running
compileTestKotlin
. Especially sinceCount
andMax
return different types.
Confirmed by running compileTestKotlin
with the Kotlin version set to 2.0.0-Beta4 ✅
The tests
testAdjustQueryHaving
,testQueryAndHaving
, andtestQueryOrHaving
falsely resolve thiseq
functioninfix fun <T : Comparable, V : T?, E : EntityID?> Expression.eq(
other: ExpressionWithColumnType
): Op = other eq this
instead of this
infix fun <T, S1 : T?, S2 : T?> Expression.eq(other: Expression): Op = when (other as Expression<*>) {
is Op.NULL -> isNull()
else -> EqOp(this, other)
}
The same happens when using
neq
,less
,lessEq
,greater
, andgreaterEq
, so those are fixed in this commit too.Even when the correct function is resolved, a compiler warning still shows up because the compiler cannot infer the type of the argument when
Long
andInt
are being compared. To remove the warning, the types are explicitly passed to theeq
function like this.eq<Number, Long, Int>
.This was tested with Kotlin 2.0.0-Beta4.