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

Linker deux fois le même_module #3574

Closed
vicuna opened this issue Apr 1, 2005 · 1 comment
Closed

Linker deux fois le même_module #3574

vicuna opened this issue Apr 1, 2005 · 1 comment
Assignees

Comments

@vicuna
Copy link

vicuna commented Apr 1, 2005

Original bug ID: 3574
Reporter: administrator
Assigned to: @mshinwell
Status: resolved (set by @mshinwell on 2016-12-08T13:06:27Z)
Resolution: fixed
Priority: normal
Severity: feature
Category: ~DO NOT USE (was: OCaml general)
Monitored by: @glondu

Bug description

Hello,

ocamlc ne se plaint pas lorsqu'on linke deux fois le même module. Cela
casse l'abstraction de type, comme le montre l'exemple suivant:

A.mli:
type t
val mk: unit -> t
val compare: t -> t -> int

A.ml:
type t = int
let counter = ref 0
let mk () = incr counter; !counter
let compare = compare

B.ml:
let a = A.mk ()

C.ml:
let a = A.mk () in
Printf.printf "%i\n" (A.compare B.a a)

Normalement, deux objets de type A.t sont égaux (pour A.compare) ss'ils
ont été produits par le même appel à A.mk. Or:

buzet ~/bug $ ocamlc -o x a.cmo b.cmo a.cmo c.cmo
buzet ~/bug $ ./x
0

Je viens de me faire attraper par ce comportement (une fonction
"forward" qui disparaissait)...

-- Alain

@vicuna
Copy link
Author

vicuna commented Dec 8, 2016

Comment author: @mshinwell

This appears to have been fixed (warning 31).

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

2 participants