-
Notifications
You must be signed in to change notification settings - Fork 686
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: EXPOSED-114 Type parameter can't be inferred for EntityID with eq/neq op #1961
Conversation
…q/neq op An IDE warning is shown stating incompatible upper bounds (which will become an error in later Kotlin version) when using a comparison operator between an EntityID column and a column of matching non-EntityID type. An overload to handle EntityID columns against other Expressions (instead of just values) has been added for every relevant comparison operator. @LowPriorityInOverloadResolution is added to ensure no compilation ambiguity error (as has already been done for eq/neq).
…q/neq op Add symmetric operators for new overloads and adjust test.
1013810
to
59354a1
Compare
@LowPriorityInOverloadResolution | ||
infix fun <T : Comparable<T>, S : T?> ExpressionWithColumnType<in S>.less(t: T): LessOp = LessOp(this, wrap(t)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As was already done for eq()
and neq()
above, this is necessary to ensure the right overload is used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @bog-walk, great job!
LGTM
After updating to 0.47.0 from 0.46.0, I'm now getting:
With this code:
This PR seems to be the only related change in the change log. |
Hi @scottkennedy I came across this issue today as well and a fix will be pushed shortly. Here is the issue ticket, EXPOSED-280, if you'd like to track it. |
The following warning shows when a comparison operator is used between an
EntityID
column and a column of matching non-EntityID
type:This happens because there is no overload for this type of comparison, so the overload being used is this one:
Appropriate overloads have been added for each relevant comparison op.