Skip to content

Fatal error: exception Assert_failure("typing/ctype.ml", 1891, 19) #6163

@vicuna

Description

@vicuna

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions