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
Namespace pollution when using 'module type of' in an explicit interface for a pack #6305
Comments
Comment author: @garrigue The cause is clear: p.mli does refer to A. This said, you have a point that 'module type of' is special: it just defines a new module type, which is not directly tied to A, so there would be no problem in not introducing this dependency. |
Comment author: @xavierleroy Any new developments about this PR? |
Comment author: @mshinwell Jacques: ping |
Comment author: @xavierleroy Again: Any new developments about this PR? |
Comment author: @garrigue Thanks for the ping. I'll have one more look into this. |
This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc. |
Close it in favour of duplicate #6433, which has a better discussion. |
Original bug ID: 6305
Reporter: Julien Signoles
Assigned to: @garrigue
Status: feedback (set by @garrigue on 2014-01-26T10:09:04Z)
Resolution: open
Priority: normal
Severity: minor
Version: 4.00.1
Category: typing
Has duplicate: #6433
Related to: #6304 #6325
Monitored by: @gasche @diml @hcarty @yakobowski
Bug description
=== a.ml ===
let x = 0
=== p.mli ===
module A: module type of A
==== q.mli ===
module A: sig val x: int end (* equivalent (?) to p.mli *)
$ ocamlc -c a.ml
$ ocamlc -c p.mli
$ ocamlc -o p.cmo -pack a.cmo
$ ocamlobjinfo p.cmi
File p.cmi
Unit name: P
Interfaces imported:
aab12b8603ccba471f3d2352b15b1331 P
7e0edf9c5f96b410a30ce34a6431a15b A
4836c254f0eacad92fbf67abc525fdda Pervasives
$ ocamlc -c q.mli
$ ocamlc -o q.cmo -pack a.cmo
$ ocamlobjinfo q.cmi
File q.cmi
Unit name: Q
Interfaces imported:
1126f1d48cd89cc39040dfe4e143dfa6 Q
4836c254f0eacad92fbf67abc525fdda Pervasives
I think P and Q should be equivalent but A is visible in P (polluting namespace) and not in Q.
The text was updated successfully, but these errors were encountered: