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 error message #4534

Closed
vicuna opened this Issue Apr 12, 2008 · 2 comments

Comments

Projects
None yet
1 participant
@vicuna
Copy link
Collaborator

vicuna commented Apr 12, 2008

Original bug ID: 4534
Reporter: turpin
Status: closed (set by @garrigue on 2010-04-30T05:18:41Z)
Resolution: fixed
Priority: normal
Severity: feature
Version: 3.10.2
Fixed in version: 3.12.0+dev
Category: ~DO NOT USE (was: OCaml general)
Monitored by: "Julien Signoles"

Bug description

file delme.ml, no .mli:

module type T = sig
val foo : unit
val foo : unit
end

yields the following error message, which is meaningless and totally different from what we would get with modules:

The implementation delme.ml
does not match the interface (inferred signature):
Module type declarations do not match:
module type T = sig val foo : unit val foo : int end
does not match
module type T = sig val foo : unit val foo : int end
Modules do not match:
sig val foo : unit val foo : int end
is not included in
sig val foo : unit val foo : int end
Values do not match: val foo : int is not included in val foo : unit

If I put the module type inside a module, the message beomes:

The implementation delme.ml
does not match the interface (inferred signature):
Modules do not match:
sig module type T = sig val foo : unit val foo : unit end end
is not included in
sig module type T = sig val foo : unit val foo : unit end end
Module type declarations do not match:
module type T = sig val foo : unit val foo : unit end
does not match
module type T = sig val foo : unit val foo : unit end
Illegal permutation of structure fields

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Aug 4, 2008

Comment author: @damiendoligez

Can't reproduce with 3.11+dev14 or 3.10.3+dev2: I get the second error message in both cases.

I'm filing this as a feature wish: we should refuse a module type that has duplicate field names, with a specific error message.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Apr 30, 2010

Comment author: @garrigue

Fixed by release 10263 (only keep the last field with same name in module types).

@vicuna vicuna closed this Apr 30, 2010

@vicuna vicuna added the feature-wish label Mar 19, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.