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

Fatal error: exception Ctype.Unify(_) #6513

vicuna opened this issue Aug 12, 2014 · 3 comments

Fatal error: exception Ctype.Unify(_) #6513

vicuna opened this issue Aug 12, 2014 · 3 comments


Copy link

@vicuna vicuna commented Aug 12, 2014

Original bug ID: 6513
Reporter: dario
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2017-02-16T14:16:28Z)
Resolution: fixed
Priority: high
Severity: major
Version: 4.02.0+beta1 / +rc1
Target version: 4.02.1+dev
Fixed in version: 4.02.0+dev
Category: typing
Related to: #6981

Bug description

The following mli code causes the compiler to abort with a Ctype.Unify(_)
exception. This happens both in 4.01.0 and the latest 4.02 trunk snapshot
(both installed via OPAM).

To attempt compilation you need the latest Tyxml installed. Running
"ocamlfind ocamlc -package tyxml -c test.mli" suffices to reproduce
the error. (My apologies for not being able to produce a self-contained
example. I found that even small tweaks to the functor make the problem
go away.)

module type S =
type t
type u

module Make: functor (Html5: Html5_sigs.T with type 'a Xml.wrap = 'a and type 'a wrap = 'a and type 'a list_wrap = 'a list) -> S with
type t = Html5_types.div Html5.elt and
type u = < foo: Html5.uri >

Steps to reproduce

  1. Install Tyxml 3.2.x (e.g. "opam install tyxml")

  2. Save code fragment as test.mli

  3. ocamlfind ocamlc -package tyxml -c test.mli

Copy link

@vicuna vicuna commented Aug 20, 2014

Comment author: @mshinwell

Jacques, do you have any time to have a look at this one?

Copy link

@vicuna vicuna commented Aug 21, 2014

Comment author: @garrigue

I'm back from holidays today and I'll try to look into it,
but the opam dependency makes things harder.

Copy link

@vicuna vicuna commented Aug 21, 2014

Comment author: @garrigue

Fixed in 4.02, at revision 15119.

The problem was a missing Ctype.init_def(Ident.current_time())
after introducing the functor argument in the environment.
As a result, update_level would fail attempting to lower the
level of the argument below its stamp.

The following stripped down example has no dependencies:

module type S = sig type u end

module type T = sig
type 'a wrap
type uri

module Make: functor (Html5 : T with type 'a wrap = 'a) ->
S with type u = < foo : Html5.uri >

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants