Skip to content
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

Broken eq/neq #1489

Closed
JajaComp opened this issue Apr 13, 2022 · 7 comments
Closed

Broken eq/neq #1489

JajaComp opened this issue Apr 13, 2022 · 7 comments

Comments

@JajaComp
Copy link
Contributor

After update to version 0.38.1 i got issue:
I have field in entity:
val object_id = reference("object_id", ObjectEntity).nullable()

and now i can't correct check this:

val objectId: UUID? = null
val where1 = Op.build { _LocalRoleEntity.object_id eq objectId }
val where2 = Op.build { _LocalRoleEntity.object_id neq objectId }
@Tapac
Copy link
Contributor

Tapac commented Apr 16, 2022

Is the problem the same if you'll replace your reference with optReference("object_id", ObjectEntity) ?

@JajaComp
Copy link
Contributor Author

This does not change anything.

Type mismatch.
Required:
TypeVariable(T)
Found:
UUID?

In version 0.37.3 all fine

Tapac added a commit that referenced this issue Apr 16, 2022
@Tapac Tapac closed this as completed Apr 16, 2022
@Tapac
Copy link
Contributor

Tapac commented Apr 16, 2022

will be fixedin the next release

@ESchouten
Copy link

@Tapac I guess this has to be done with neq as well

@Tapac
Copy link
Contributor

Tapac commented Apr 20, 2022

@ESchouten, oh, my bad. It was not so easy to find the way to fix for eq and I forgot about neq.
Thank you for notice.

Tapac added a commit that referenced this issue Apr 20, 2022
@mark-sinclair-tw
Copy link

I was attempting to upgrade from 0.37.3 to 0.38.2, and noticed I was getting new compiler errors when comparing a database ID to a nullable Int? with neq:

val itemID: Int? = 5
Items.select { Items.id neq itemID }

fails to compile with Type mismatch: inferred type is Int? but TypeVariable(T) was expected

This was marked as fixed in the April 19 0.38.2 release here: https://github.com/JetBrains/Exposed/blob/master/docs/ChangeLog.md#0382

But the commit that actually fixed it did not make it into that release, and only happened on April 20: b456bbe#diff-3c3e7274f9f251b7e17658c0519a0852fe3b698401e13203c8f19828a8612e68

So we have to hold back upgrading until the next release is out

@Tapac
Copy link
Contributor

Tapac commented Jul 16, 2022

@mark-sinclair-tw , sorry for a delay with the release. It will be on the next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants