Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006163OCamlOCaml typingpublic2013-09-06 03:182013-09-06 07:54
Reporterlpw25 
Assigned Togarrigue 
PrioritynormalSeveritycrashReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version4.01.0+beta/+rc 
Target VersionFixed in Version4.01.0+dev 
Summary0006163: Fatal error: exception Assert_failure("typing/ctype.ml", 1891, 19)
DescriptionThe 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
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0010318)
garrigue (manager)
2013-09-06 07:54

Fixed in trunk and 4.01, revision 14067.

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.

- Issue History
Date Modified Username Field Change
2013-09-06 03:18 lpw25 New Issue
2013-09-06 07:54 garrigue Note Added: 0010318
2013-09-06 07:54 garrigue Status new => resolved
2013-09-06 07:54 garrigue Fixed in Version => 4.01.0+dev
2013-09-06 07:54 garrigue Resolution open => fixed
2013-09-06 07:54 garrigue Assigned To => garrigue


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker