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

Failure to evaluate top level expressions in dependant module #4374

Closed
vicuna opened this issue Aug 28, 2007 · 1 comment
Closed

Failure to evaluate top level expressions in dependant module #4374

vicuna opened this issue Aug 28, 2007 · 1 comment
Labels

Comments

@vicuna
Copy link

vicuna commented Aug 28, 2007

Original bug ID: 4374
Reporter: Vassili Karpov
Status: closed (set by @xavierleroy on 2007-10-25T08:37:29Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.10.0
Category: ~DO NOT USE (was: OCaml general)
Related to: #4166

Bug description

Apparently if module A uses only external functions originating from module B,
no top level expressions from B will be evaluated (before those in A).

For instance:

thr.ml:
(let d () = Thread.delay;;)
let _ =
print_int (Thread.id (Thread.self ()))
;;

thr$ ocaml -I +threads unix.cma threads.cma thr.ml
0
thr$ ocamlc -thread threads.cma thr.ml
thr$ ./a.out
Fatal error: exception Invalid_argument("Thread.self: not initialized")

As seen here ocamlc does not even think that thr.ml depends on unix.cma.
Uncommenting first line of thr.ml "solves" the problem.

Additional information

http://caml.inria.fr/pub/ml-archives/caml-list/2005/04/71238550c70f9f010076c06898f8a840.en.html

@vicuna
Copy link
Author

vicuna commented Oct 25, 2007

Comment author: @xavierleroy

Fixed in 3.10 release branch. (Replace "external" declarations by "val" declarations in otherlibs/systhreads/thread.mli.)

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