diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 2003-06-23 14:00:49 +0000 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 2003-06-23 14:00:49 +0000 |
commit | fe77ea4a69e33881b0ec9c771f806f951699e8aa (patch) | |
tree | ba062f15c26a9195c7959d4336ab466bda6d6b9b | |
parent | 50bdc60761ff2b25379abf32d2b37378bc9efad3 (diff) |
Option -i: ignorer la presence d'un .mli
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5619 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r-- | typing/typemod.ml | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/typing/typemod.ml b/typing/typemod.ml index 3c2e9adac..01de20a9a 100644 --- a/typing/typemod.ml +++ b/typing/typemod.ml @@ -708,23 +708,26 @@ let type_implementation sourcefile prefixname modulename initial_env ast = (fun () -> Stypes.dump (prefixname ^ ".annot")) in Typecore.force_delayed_checks (); - if !Clflags.print_types then + if !Clflags.print_types then begin fprintf std_formatter "%a@." Printtyp.signature (simplify_signature sg); - let coercion = - if Sys.file_exists (prefixname ^ !Config.interface_suffix) then begin - let intf_file = - try find_in_path !Config.load_path (prefixname ^ ".cmi") - with Not_found -> prefixname ^ ".cmi" in - let dclsig = Env.read_signature modulename intf_file in - Includemod.compunit sourcefile sg intf_file dclsig - end else begin - check_nongen_schemes finalenv str; - normalize_signature finalenv sg; - if not !Clflags.dont_write_files && not !Clflags.print_types then - Env.save_signature sg modulename (prefixname ^ ".cmi"); - Tcoerce_none - end in - (str, coercion) + (str, Tcoerce_none) + end else begin + let coercion = + if Sys.file_exists (prefixname ^ !Config.interface_suffix) then begin + let intf_file = + try find_in_path !Config.load_path (prefixname ^ ".cmi") + with Not_found -> prefixname ^ ".cmi" in + let dclsig = Env.read_signature modulename intf_file in + Includemod.compunit sourcefile sg intf_file dclsig + end else begin + check_nongen_schemes finalenv str; + normalize_signature finalenv sg; + if not !Clflags.dont_write_files then + Env.save_signature sg modulename (prefixname ^ ".cmi"); + Tcoerce_none + end in + (str, coercion) + end (* "Packaging" of several compilation units into one unit having them as sub-modules. *) |