Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Type equality broken for conjunctive polymorphic variant tags #5927
Original bug ID: 5927
I think that the following behaviour is a bug:
type 'a foo = 'a constraint 'a = [< `Tag of & int];;
Error: Type declarations do not match:
I've attached a patch that seems to fix it.
Comment author: @garrigue
Actually, the failure in this case is intentional, as this conjunction is clearly impossible.
Comment author: @lpw25
Even if the conjunction is impossible, the type itself is valid and should at least be considered equivalent to itself.
Also, the current error is unclear and only occurs during module inclusion checks. For example:
module type S = sig type 'a foo constraint 'a = [< `Tag of & int ] end;;
Error: Module type declarations do not match: