Skip to content

unexpected (?) typing error related to aliasing of types defined in recursive modules #7622

@vicuna

Description

@vicuna

Original bug ID: 7622
Reporter: kosik
Status: resolved (set by @xavierleroy on 2017-09-30T09:24:30Z)
Resolution: suspended
Priority: normal
Severity: minor
Version: 4.05.0
Category: typing
Tags: recmod
Monitored by: @gasche

Bug description

If my "b.mli" file contains the following code:

(1) module rec A :
(2) sig
(3) type t = T1
(4) end
(5)
(6) and B :
(7) sig
(8) type t = A.t = T1
(9) end

and I try to compile this file:

ocamlc -c b.mli

then I get the following error message:

File "b.mli", line 8, characters 9-26:
Error: This variant or record definition does not match that of type A.t
Their kinds differ.

I've asked about this on caml-list
https://sympa.inria.fr/sympa/arc/caml-list/2017-08/msg00043.html
but I haven't got a reply.

My questions:

  • What does the error message mean?
    (Is it really necessary to reject the above fragment as ill-typed?)
    • What is the kind of A.t?
    • What is the kind of B.t?
    • Why are the kinds of of B.t and A.t different?

Steps to reproduce

ocamlc -c b.mli

File attachments

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions