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

Non-compatibility assumed between concrete types with same constructor #5997

Closed
vicuna opened this issue Apr 22, 2013 · 1 comment
Closed

Non-compatibility assumed between concrete types with same constructor #5997

vicuna opened this issue Apr 22, 2013 · 1 comment

Comments

@vicuna
Copy link

@vicuna vicuna commented Apr 22, 2013

Original bug ID: 5997
Reporter: @gasche
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2015-12-11T18:18:38Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.01.0+dev
Fixed in version: 4.00.2+dev
Category: typing
Related to: #5989
Child of: #5998

Bug description

type (_, _) comp =
| Eq : ('a, 'a) comp
| Diff : ('a, 'b) comp

module U = struct type t = T end

module M : sig
type t = T
val comp : (U.t, t) comp
end = struct
include U
let comp = Eq
end

match M.comp with | Diff -> false;;

  • : bool = false

I checked this example against both the trunk (in particular after the recent "incompatibility check" fixes) and the non-vanishing branch.

@vicuna
Copy link
Author

@vicuna vicuna commented Apr 23, 2013

Comment author: @garrigue

Fix in trunk and 4.00, commits 13586 and 13587.

This was a particularly stupid bug:
constructors were compared by id rather than by name, and as a result independent copies of the same definition were all incompatible.
Also fixed the same problem for records.

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

Successfully merging a pull request may close this issue.

None yet
3 participants