Fix #9695: no error when opening an alias to a missing module

master
Jacques Garrigue 2020-06-23 15:31:45 +02:00
parent 607bd8d27d
commit 6ccab9b9b0
4 changed files with 21 additions and 3 deletions

View File

@ -712,6 +712,9 @@ OCaml 4.11
(Gabriel Scherer, review by Jacques Garrigue and Leo White,
report by Hugo Heuzard)
- #9695: no error when opening an alias to a missing module
(Jacques Garrigue, report by Gabriel Scherer)
OCaml 4.10 maintenance branch
-----------------------------

View File

@ -0,0 +1,4 @@
File "pr9695_bad.ml", line 10, characters 18-19:
10 | let () = let open A in x
^
Error: This is an alias for module MissingModule, which is missing

View File

@ -0,0 +1,10 @@
(* TEST
flags = " -w a -no-alias-deps"
ocamlc_byte_exit_status = "2"
* setup-ocamlc.byte-build-env
** ocamlc.byte
*** check-ocamlc.byte-output
*)
module A = MissingModule
let () = let open A in x

View File

@ -2002,9 +2002,10 @@ let add_components slot root env0 comps =
}
let open_signature slot root env0 =
match get_components (find_module_components root env0) with
| Functor_comps _ -> None
| Structure_comps comps ->
match get_components_res (find_module_components root env0) with
| Error _
| Ok (Functor_comps _) -> None
| Ok (Structure_comps comps) ->
Some (add_components slot root env0 comps)