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

#show_module prints types incorrectly #6587

Closed
vicuna opened this issue Sep 29, 2014 · 3 comments

Comments

Projects
None yet
2 participants
@vicuna
Copy link

commented Sep 29, 2014

Original bug ID: 6587
Reporter: jcf
Assigned to: @garrigue
Status: resolved (set by @garrigue on 2017-03-16T00:22:57Z)
Resolution: fixed
Priority: normal
Severity: feature
Version: 4.02.0+beta1 / +rc1
Target version: undecided
Fixed in version: 4.06.0 +dev/beta1/beta2/rc1
Category: typing
Child of: #4791
Monitored by: @gasche @hcarty

Bug description

With the code below, the OCaml toplevel prints

module M : sig type in_channel val f : in_channel -> in_channel end

that is, it prints the two types M.in_channel and Pervasives.in_channel the same way. (I found this while playing with camlzip, which has a module containing a type called in_channel.)

Steps to reproduce

module M = struct
type in_channel
let f (c: Pervasives.in_channel) : in_channel = assert false
end;;

#show_module M;;

@vicuna

This comment has been minimized.

Copy link
Author

commented Sep 29, 2014

Comment author: @garrigue

The problem is specific to Pervasives: omitting the prefix is hard-wired in Printtyp.
Note that this is not specific to #show_module: this is just the behavior of the standard printer.

@vicuna

This comment has been minimized.

Copy link
Author

commented Mar 15, 2017

Comment author: @Octachron

I have proposed a patch in #1109 to only perform this Pervasives prefix elision when it is unambiguous in the current printing environment.

@vicuna

This comment has been minimized.

Copy link
Author

commented Mar 16, 2017

Comment author: @garrigue

Merge #1109 after light edit, in commit 929b99b.
Thanks for the code.

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.