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

Confusing type error message with recursive modules #4570

Closed
vicuna opened this issue Jun 26, 2008 · 3 comments
Closed

Confusing type error message with recursive modules #4570

vicuna opened this issue Jun 26, 2008 · 3 comments
Milestone

Comments

@vicuna
Copy link

vicuna commented Jun 26, 2008

Original bug ID: 4570
Reporter: @yallop
Status: closed (set by @xavierleroy on 2015-12-11T18:21:16Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.10.2
Target version: 4.01.0+dev
Category: ~DO NOT USE (was: OCaml general)
Tags: recmod

Bug description

The following (wrong) code

module rec M : sig type 'a s = 'a N.t end =
struct type 'a s = 'a N.t end
and N : sig type 'a t end =
struct type t end

gives rise to the following confusing error message:

             struct type 'a s = 'a N.t end
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Signature mismatch:
Modules do not match:
sig type 'a s = 'a N.t end
is not included in
sig type 'a s = 'a N.t end
Type declarations do not match:
type 'a s = 'a N.t
is not included in
type 'a s = 'a N.t

It'd be less surprising if the mismatch between the number of type parameters in the structure and signature declarations of N.t were reported instead.

@vicuna
Copy link
Author

vicuna commented Sep 4, 2008

Comment author: @damiendoligez

Strange, 3.10.0 gave a much better error message.

@vicuna
Copy link
Author

vicuna commented Aug 6, 2012

Comment author: @xavierleroy

I've been sleeping on these PR for too long, and still have no idea how to address them. Unassigning them from myself.

@vicuna
Copy link
Author

vicuna commented Jul 29, 2013

Comment author: @damiendoligez

Looks like this has been fixed at some point in the past:

Error: Signature mismatch:
Modules do not match:
sig type t = N.t end
is not included in
sig type 'a t end
Type declarations do not match:
type t = N.t
is not included in
type 'a t
They have different arities.

@vicuna vicuna closed this as completed Dec 11, 2015
@vicuna vicuna added the typing label Mar 14, 2019
@vicuna vicuna added this to the 4.01.0 milestone Mar 14, 2019
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant