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.
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 =
Bend
let _ = match M.x with `A s -> s
$ ocaml pr.ml
Segmentation fault
Additional information
Inspired by PR7703
The text was updated successfully, but these errors were encountered: