Skip to content

Commit

Permalink
fix: Tests testAdjustQueryHaving, testQueryAndHaving, and `testQu…
Browse files Browse the repository at this point in the history
…eryOrHaving` resolve wrong `eq` function

The tests falsely resolve this `eq` function

infix fun <T : Comparable<T>, V : T?, E : EntityID<T>?> Expression<in V>.eq(
        other: ExpressionWithColumnType<E>
    ): Op<Boolean> = other eq this

instead of this

infix fun <T, S1 : T?, S2 : T?> Expression<in S1>.eq(other: Expression<in S2>): Op<Boolean> = when (other as Expression<*>) {
        is Op.NULL -> isNull()
        else -> EqOp(this, other)
    }

The same happens when using `neq` instead of `eq`, so that is fixed in this commit too.
  • Loading branch information
joc-a committed Feb 29, 2024
1 parent 1742b95 commit 3f0deff
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ interface ISqlExpressionBuilder {
}

/** Checks if this expression is equal to some [other] [EntityID] expression. */
infix fun <T : Comparable<T>, V : T?, E : EntityID<T>?> Expression<in V>.eq(
infix fun <T : Comparable<T>, V : T?, E : EntityID<T>?> Expression<V>.eq(
other: ExpressionWithColumnType<E>
): Op<Boolean> = other eq this

Expand Down Expand Up @@ -377,7 +377,7 @@ interface ISqlExpressionBuilder {
}

/** Checks if this expression is not equal to some [other] [EntityID] expression. */
infix fun <T : Comparable<T>, V : T?, E : EntityID<T>?> Expression<in V>.neq(
infix fun <T : Comparable<T>, V : T?, E : EntityID<T>?> Expression<V>.neq(
other: ExpressionWithColumnType<E>
): Op<Boolean> = other neq this

Expand Down

0 comments on commit 3f0deff

Please sign in to comment.