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

include module feature with duplicate ident #2826

Closed
vicuna opened this issue Jul 3, 2001 · 2 comments
Closed

include module feature with duplicate ident #2826

vicuna opened this issue Jul 3, 2001 · 2 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Jul 3, 2001

Original bug ID: 423
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Full_Name: Claude Marché
Version: 3.01
OS: Debian GNU/Linux
Submission from: serveur-demons.lri.fr (129.175.8.130)

There seems to be a pb when including a module and then redefining an ident.
Here are 3 ml source files and a makefile that show the bug. Strangely, the
bug only shows up when using ocamlopt and separate compilation.

--- file defaults.ml ---
let f () = prerr_endline "Defaults.f called";;

--- file redef.ml ---
include Defaults;;
let f () = prerr_endline "Redef.f called";;

--- file main.ml ---
Redef.f ();;

--- Makefile ---
main1:
ocamlc -o main1 defaults.ml redef.ml main.ml

main2:
ocamlc -c defaults.ml
ocamlc -c redef.ml
ocamlc -c main.ml
ocamlc -o main2 defaults.cmo redef.cmo main.cmo

main3:
ocamlopt -o main3 defaults.ml redef.ml main.ml

main4:
ocamlopt -c defaults.ml
ocamlopt -c redef.ml
ocamlopt -c main.ml
ocamlopt -o main4 defaults.cmx redef.cmx main.cmx

clean:
rm -f .cm *.o main[1-4]

--- results ---

make clean main1 main2 main3 main4
rm -f .cm *.o main[1-4]
ocamlc -o main1 defaults.ml redef.ml main.ml
ocamlc -c defaults.ml
ocamlc -c redef.ml
ocamlc -c main.ml
ocamlc -o main2 defaults.cmo redef.cmo main.cmo
ocamlopt -o main3 defaults.ml redef.ml main.ml
ocamlopt -c defaults.ml
ocamlopt -c redef.ml
ocamlopt -c main.ml
ocamlopt -o main4 defaults.cmx redef.cmx main.cmx
./main1
Redef.f called
./main2
Redef.f called
./main3
Redef.f called
./main4
Defaults.f called

@vicuna
Copy link
Author

vicuna commented Jul 5, 2001

Comment author: administrator

Bonjour Claude,

There seems to be a pb when including a module and then redefining an ident.
Here are 3 ml source files and a makefile that show the bug. Strangely, the
bug only shows up when using ocamlopt and separate compilation.

C'est en effet un bug lié à un manque d'alpha-conversion dans certains
cas. C'est corrigé dans la version de travail. Merci de l'avoir mis
en évidence et signalé.

  • Xavier Leroy

@vicuna
Copy link
Author

vicuna commented Jul 5, 2001

Comment author: administrator

Fixed 2001-07-05 by XL.

@vicuna vicuna closed this as completed Jul 5, 2001
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant