Skip to content

Commit 8466bfa

Browse files
committed
Bind parameterized modules locally
This bug was unlikely to surface since we can't actually test the compilation of an import of a parameterized module yet (and the PRs that can test it already fix this bug), but now it's fixed anyway.
1 parent 32ea6ef commit 8466bfa

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ocaml/typing/persistent_env.ml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ type import = {
6969
imp_is_param : bool;
7070
imp_params : Compilation_unit.Name.t list;
7171
imp_arg_for : Compilation_unit.Name.t option;
72-
imp_impl : CU.t option;
72+
imp_impl : CU.t option; (* None iff import is a parameter *)
7373
imp_sign : Subst.Lazy.signature;
7474
imp_filename : string;
7575
imp_visibility: Load_path.visibility;
@@ -348,10 +348,10 @@ let check_for_unset_parameters penv modname import =
348348
}))
349349
import.imp_params
350350

351-
let make_binding _penv modname (impl : CU.t option) : binding =
352-
match impl with
353-
| Some unit -> Static unit
354-
| None ->
351+
let make_binding _penv modname (import : import) : binding =
352+
match import with
353+
| { imp_impl = Some unit; imp_params = [] } -> Static unit
354+
| { imp_impl = None } | { imp_params = _ :: _ } ->
355355
Local (Ident.create_local_binding_for_global (CU.Name.to_string modname))
356356

357357
type address =
@@ -387,7 +387,7 @@ let acknowledge_pers_struct penv modname import val_of_pers_sig =
387387
| true, true
388388
| false, false -> ()
389389
end;
390-
let binding = make_binding penv modname impl in
390+
let binding = make_binding penv modname import in
391391
let address : address =
392392
match binding with
393393
| Local id -> Alocal id

0 commit comments

Comments
 (0)