Skip to content

Conversation

@sim642
Copy link
Member

@sim642 sim642 commented Dec 30, 2025

While looking at all the Unknown cast kinds in #1896, I realized that all the int casts of FloatDomain predicate results are pointless because they are already int by construction.

In order to enforce this on the OCaml type level, it's better to have those predicates return bool option instead of ID.t, which is implicitly assumed/required to correspond to a boolean (but in int, not _Bool).
In fact this revealed that some of those operations actually were incorrectly returning _Bool, so the cast was necessary before.

This simplifies their implementations and reduces the IntDomain dependency of FloatDomain.
I've been thinking about a similar simplification in IntDomain, but it's a bit more involved due to the many different module interfaces.

@sim642 sim642 added this to the v2.8.0 Clumsy Clurichaun milestone Dec 30, 2025
@sim642 sim642 added cleanup Refactoring, clean-up type-safety Type-safety improvements labels Dec 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup Refactoring, clean-up type-safety Type-safety improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants