You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 7058 Reporter:@bobzhang Status: closed (set by @xavierleroy on 2017-02-16T14:16:33Z) Resolution: not a bug Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
Bug description
put this in array.tst.ml
module U= Array
it will complain unbound module Array
FYI, I am doing test for my ocaml to javascript compiler following javascript convention, I understand that filename is used as module name in OCaml, so it is not that easy to fix
The text was updated successfully, but these errors were encountered:
I don't understand what the problem is here actually. Whatever the extension is, the type checker should not behave differently (as long as it can recognize it).
Having such "pre"-extension might be useful for your build system (for calling automatically a preprocessor for example), but not to change the typing of the program.
However, the error message may be a bit confusing, since the problem is that the module Array is referencing itself (because indeed, filenames are module names).
As @pcouderc mentions, array.tst.ml defines a compilation unit named Array, and a unit cannot refer to itself by name. The error message is not that good, though. Changing the conventional mapping from filename to compilation unit name would cause as much trouble as it solves here, since "Array.tst" is not a valid name for a compilation unit either.
Your best bet is to adopt a different naming convention, e.g. "array_tst.ml".
Original bug ID: 7058
Reporter: @bobzhang
Status: closed (set by @xavierleroy on 2017-02-16T14:16:33Z)
Resolution: not a bug
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
put this in array.tst.ml
module U= Array
it will complain unbound module Array
FYI, I am doing test for my ocaml to javascript compiler following javascript convention, I understand that filename is used as module name in OCaml, so it is not that easy to fix
The text was updated successfully, but these errors were encountered: