You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 5927 Reporter:@lpw25 Assigned to:@garrigue Status: resolved (set by @garrigue on 2017-03-14T10:20:51Z) Resolution: fixed Priority: normal Severity: minor Target version: undecided Fixed in version: 4.06.0 +dev/beta1/beta2/rc1 Category: typing Tags: patch Monitored by:@lpw25
Bug description
I think that the following behaviour is a bug:
type 'a foo = 'a constraint 'a = [< `Tag of & int];;
Error: Type declarations do not match:
type 'a foo = 'a constraint 'a = [< Tag of & int ] is not included in type 'a foo = 'a constraint 'a = [< Tag of & int ]
Actually, the failure in this case is intentional, as this conjunction is clearly impossible.
On the other hand, it could be accepted in a more general way: & t1 is probably equivalent to & t2 for any t1 and t2...
(Oops, there is also the problem of free variables)
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:
module type S =
sig type 'a foo constraint 'a = [< Tag of & int ] end does not match module type S = sig type 'a foo constraint 'a = [< Tag of & int ] end
At position module type S =
Modules do not match:
sig type 'a foo constraint 'a = [< Tag of & int ] end is not included in sig type 'a foo constraint 'a = [< Tag of & int ] end
At position module type S =
Type declarations do not match:
type 'a foo constraint 'a = [< Tag of & int ] is not included in type 'a foo constraint 'a = [< Tag of & int ]
Their constraints differ.
Original bug ID: 5927
Reporter: @lpw25
Assigned to: @garrigue
Status: resolved (set by @garrigue on 2017-03-14T10:20:51Z)
Resolution: fixed
Priority: normal
Severity: minor
Target version: undecided
Fixed in version: 4.06.0 +dev/beta1/beta2/rc1
Category: typing
Tags: patch
Monitored by: @lpw25
Bug description
I think that the following behaviour is a bug:
type 'a foo = 'a constraint 'a = [< `Tag of & int];;
Error: Type declarations do not match:
type 'a foo = 'a constraint 'a = [<
Tag of & int ] is not included in type 'a foo = 'a constraint 'a = [<
Tag of & int ]I've attached a patch that seems to fix it.
File attachments
The text was updated successfully, but these errors were encountered: