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

Soundness issue with private rows and module inclusion #7704

Closed
vicuna opened this Issue Jan 3, 2018 · 6 comments

Comments

Projects
None yet
2 participants
@vicuna
Copy link
Collaborator

vicuna commented Jan 3, 2018

Original bug ID: 7704
Reporter: @yallop
Assigned to: @garrigue
Status: resolved (set by @garrigue on 2018-01-09T07:50:05Z)
Resolution: fixed
Priority: normal
Severity: crash
Fixed in version: 4.06.1+dev/rc1/rc2
Category: typing
Monitored by: igarnier @nojb @gasche

Bug description

With OCaml 4.06.0:

$ cat pr.ml
module M : sig
type t = private [> A of string ] val x : t end = struct type t = private [> A of string | B ] let x = B
end

let _ = match M.x with `A s -> s

$ ocaml pr.ml
Segmentation fault

Additional information

Inspired by PR7703

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Jan 4, 2018

Comment author: @lpw25

This seems to have appeared between 4.02.3 and 4.03.0.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Jan 5, 2018

Comment author: @garrigue

Well, to be more precise, matching on an open polymorphic variant type without a default case should raise a warning, so this is not directly related to modules.

Here is a smaller example.

type t = private [> A of string ];; function (A x : t) -> x;;

This might be related to the refinement of Parmatch for GADTs, but it's not immediate why, I will look into it.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Jan 5, 2018

Comment author: @garrigue

Fix in #1559: #1559

Someone review please...

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Jan 5, 2018

Comment author: @yallop

this is not directly related to modules

Oops -- indeed. Thanks for the diagnosis & fix.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Jan 9, 2018

Comment author: @garrigue

Fixed in trunk and 4.06 branch by commits bd1b5a0 and 9d52b4c.

@vicuna vicuna closed this Jan 9, 2018

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Jan 10, 2018

Comment author: @garrigue

Open a new PR (#1564) to provide better naming for the tags.

@vicuna vicuna added the typing label Mar 14, 2019

@vicuna vicuna added the bug label Mar 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.