summaryrefslogtreecommitdiff
path: root/stdlib
diff options
context:
space:
mode:
authorJacques Garrigue <garrigue@math.nagoya-u.ac.jp>2020-07-29 09:10:17 +0900
committerGitHub <noreply@github.com>2020-07-29 09:10:17 +0900
commit302d735ce8f965f48784b90af11aaeddf22f88d1 (patch)
treef22f04239366e7ff57346d72134fa6f8b07e5793 /stdlib
parent8b3ac9bcb27a028d1d80f7ee9bab64bcc58b455a (diff)
downloadocaml-302d735ce8f965f48784b90af11aaeddf22f88d1.tar.gz
Righteous ambivalence (#9767)
* Fix #9759: Typing without -principal is broken in 4.11 and trunk * compile stdlib in -principal mode * never modify generic part of ty_expected_explained * use generic_instance where possible * add comment for -no-principal in stdlib__oo.cmi
Diffstat (limited to 'stdlib')
-rwxr-xr-xstdlib/Compflags2
-rw-r--r--stdlib/Makefile2
-rw-r--r--stdlib/camlinternalFormat.ml4
3 files changed, 5 insertions, 3 deletions
diff --git a/stdlib/Compflags b/stdlib/Compflags
index 3fa37a3651..61f26a9254 100755
--- a/stdlib/Compflags
+++ b/stdlib/Compflags
@@ -34,5 +34,7 @@ case $1 in
stdlib__scanf.cmx) echo ' -inline 9';;
*Labels.cm[ox]) echo ' -nolabels -no-alias-deps';;
stdlib__float.cm[ox]) echo ' -nolabels -no-alias-deps';;
+ stdlib__oo.cmi) echo ' -no-principal';;
+ # preserve structure sharing in Oo.copy (PR#9767)
*) echo ' ';;
esac
diff --git a/stdlib/Makefile b/stdlib/Makefile
index 441cedaa09..9fbc01986c 100644
--- a/stdlib/Makefile
+++ b/stdlib/Makefile
@@ -22,7 +22,7 @@ TARGET_BINDIR ?= $(BINDIR)
COMPILER=$(ROOTDIR)/ocamlc$(EXE)
CAMLC=$(CAMLRUN) $(COMPILER)
COMPFLAGS=-strict-sequence -absname -w +a-4-9-41-42-44-45-48 \
- -g -warn-error A -bin-annot -nostdlib \
+ -g -warn-error A -bin-annot -nostdlib -principal \
-safe-string -strict-formats
OPTCOMPILER=$(ROOTDIR)/ocamlopt$(EXE)
CAMLOPT=$(CAMLRUN) $(OPTCOMPILER)
diff --git a/stdlib/camlinternalFormat.ml b/stdlib/camlinternalFormat.ml
index 5c2a2b3bfa..239d027cac 100644
--- a/stdlib/camlinternalFormat.ml
+++ b/stdlib/camlinternalFormat.ml
@@ -2305,7 +2305,7 @@ let fmt_ebb_of_string ?legacy_behavior str =
and get_prec () = prec_used := true; prec
and get_padprec () = pad_used := true; padprec in
- let get_int_pad () =
+ let get_int_pad () : (x,y) padding =
(* %5.3d is accepted and meaningful: pad to length 5 with
spaces, but first pad with zeros upto length 3 (0-padding
is the interpretation of "precision" for integer formats).
@@ -2330,7 +2330,7 @@ let fmt_ebb_of_string ?legacy_behavior str =
| Arg_padding _ as pad, _ -> pad in
(* Check that padty <> Zeros. *)
- let check_no_0 symb (type a) (type b) (pad : (a, b) padding) =
+ let check_no_0 symb (type a b) (pad : (a, b) padding) : (a,b) padding =
match pad with
| No_padding -> pad
| Lit_padding ((Left | Right), _) -> pad