Skip to content

Namespace pollution when using 'module type of' in an explicit interface for a pack #6305

@vicuna

Description

@vicuna

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions