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

GADT constructors can be re-exposed with an incompatible type => segfault #7378

Closed
vicuna opened this issue Sep 28, 2016 · 1 comment
Closed

GADT constructors can be re-exposed with an incompatible type => segfault #7378

vicuna opened this issue Sep 28, 2016 · 1 comment
Assignees
Milestone

Comments

@vicuna
Copy link

@vicuna vicuna commented Sep 28, 2016

Original bug ID: 7378
Reporter: @alainfrisch
Assigned to: @garrigue
Status: resolved (set by @garrigue on 2016-09-28T10:42:12Z)
Resolution: fixed
Priority: high
Severity: major
Target version: 4.04.0 +dev / +beta1 / +beta2
Fixed in version: 4.04.0 +dev / +beta1 / +beta2
Category: typing
Child of: #5998

Bug description

module X = struct
  type t =
    | A : 'a * 'b * ('a -> unit) -> t
end

module Y = struct
  type t = X.t =
    | A : 'a * 'b * ('b -> unit) -> t
end


let () =
  match Y.A (1, "", print_string) with
  | X.A (x, y, f) -> f x

The definition for Y.t should be rejected, but it's not, leading to a segfault further down.

@vicuna
Copy link
Author

@vicuna vicuna commented Sep 28, 2016

Comment author: @garrigue

Fixed in 4.04 by commit 10301ac

In presence of existential type variables in the definition, it is essential that Ctype.equal be called on all argument types simultaneously.
I kind of recall fixing that once before, so I left a comment about it in includecore.ml.

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
You can’t perform that action at this time.