Skip to content

Commit

Permalink
Fix mpr7620 (#1317)
Browse files Browse the repository at this point in the history
Call Typecore.force_delayed_checks before printing the signature for ocamlc -i
  • Loading branch information
garrigue committed Sep 12, 2017
1 parent e85d5ec commit e286dbd
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Changes
Expand Up @@ -61,6 +61,9 @@ Working version
scope of its equation
(Jacques Garrigue, report by Thomas Refis)

- MPR#7620, GPR#1317: Typecore.force_delayed_checks does not run with -i option
(Jacques Garrigue, report by Jun Furuse)

* GPR#659: Remove support for SPARC native code generation
(Mark Shinwell)

Expand Down
15 changes: 15 additions & 0 deletions testsuite/tests/typing-ocamlc-i/Makefile
@@ -0,0 +1,15 @@
# Check ocamlc -i

SOURCES = pr7620_bad.ml

all:
@printf " ... testing '$(SOURCES)'"
@$(OCAMLC) -i $(SOURCES) 2> /dev/null \
&& echo " => failed" || echo " => passed"

clean: defaultclean
@rm -f *~

BASEDIR=../..
include $(BASEDIR)/makefiles/Makefile.common

3 changes: 3 additions & 0 deletions testsuite/tests/typing-ocamlc-i/pr7620_bad.ml
@@ -0,0 +1,3 @@
let t =
(function `A | `B -> () : 'a) (`A : [`A]);
(failwith "dummy" : 'a) (* to know how 'a is unified *)
1 change: 1 addition & 0 deletions typing/typemod.ml
Expand Up @@ -1614,6 +1614,7 @@ let type_implementation sourcefile outputprefix modulename initial_env ast =
type_structure initial_env ast (Location.in_file sourcefile) in
let simple_sg = simplify_signature sg in
if !Clflags.print_types then begin
Typecore.force_delayed_checks ();
Printtyp.wrap_printing_env initial_env
(fun () -> fprintf std_formatter "%a@." Printtyp.signature simple_sg);
(str, Tcoerce_none) (* result is ignored by Compile.implementation *)
Expand Down

0 comments on commit e286dbd

Please sign in to comment.