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: 6163 Reporter:@lpw25 Assigned to:@garrigue Status: closed (set by @xavierleroy on 2016-12-07T10:37:13Z) Resolution: fixed Priority: normal Severity: crash Version: 4.01.0+beta/+rc Fixed in version: 4.01.0+dev Category: typing Related to:#6716
Bug description
The following causes an exception in the toplevel:
OCaml version 4.01.0+rc1
type _ nat =
Zero : [`Zero] nat
| Succ : 'a nat -> [`Succ of 'a] nat;;
type _ nat = Zero : [ `Zero ] nat | Succ : 'a nat -> [ `Succ of 'a ] nat
let f x =
let module Aux = struct
type aux = Aux : [ `Succ of [< `Succ of [< `Succ of [< `Succ of [`Zero] | `Zero] | `Zero] | `Zero] ] nat -> aux
end in
let f (type t) ((Aux.Aux x) : Aux.aux) =
match x with
Succ Zero -> "1"
| Succ (Succ Zero) -> "2"
| Succ (Succ (Succ Zero)) -> "3"
| Succ (Succ (Succ (Succ Zero))) -> "4"
in
f (Aux.Aux x);;
Fatal error: exception Assert_failure("typing/ctype.ml", 1891, 19)
Process ocaml-toplevel exited abnormally with code 2
The text was updated successfully, but these errors were encountered:
Note however that this does not solve the fundamental problem: at this point refinement of polymorphic variants with an upper bound is not supported for GADTs.
As a result, the function is accepted, but the exhaustiveness check fails.
Full support of polymorphic variants require changing some invariants, so this cannot be done in 4.01.
Original bug ID: 6163
Reporter: @lpw25
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2016-12-07T10:37:13Z)
Resolution: fixed
Priority: normal
Severity: crash
Version: 4.01.0+beta/+rc
Fixed in version: 4.01.0+dev
Category: typing
Related to: #6716
Bug description
The following causes an exception in the toplevel:
type _ nat =
let f x =
Process ocaml-toplevel exited abnormally with code 2
The text was updated successfully, but these errors were encountered: