From: Stephane Glondu Date: Thu, 3 Sep 2020 12:52:56 +0000 (+0200) Subject: New upstream version 4.11.1 X-Git-Tag: archive/raspbian/4.11.1-5+rpi1~1^2~25^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=3915611d8a05d55a0d89bc7c45c30cc0921bf71f;p=ocaml.git New upstream version 4.11.1 --- diff --git a/Changes b/Changes index f4354afe..62e58bd5 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,16 @@ +OCaml 4.11.1 (31 August 2020) +----------------------------- + +### Bug fixes: + +- #9856, #9857: Prevent polymorphic type annotations from generalizing + weak polymorphic variables. + (Leo White, review by Jacques Garrigue) + +- #9859, #9862: Remove an erroneous assertion when inferred function types + appear in the right hand side of an explicit :> coercion + (Florian Angeletti, review by Thomas Refis) + OCaml 4.11.0 (19 August 2020) --------------------------- diff --git a/VERSION b/VERSION index eeef3d9a..ec07a3e6 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ -4.11.0 +4.11.1 # The version string is the first line of this file. # It must be in the format described in stdlib/sys.mli diff --git a/boot/ocamlc b/boot/ocamlc index 13606009..8a4f0681 100755 Binary files a/boot/ocamlc and b/boot/ocamlc differ diff --git a/boot/ocamllex b/boot/ocamllex index c09dc74c..93067610 100755 Binary files a/boot/ocamllex and b/boot/ocamllex differ diff --git a/configure b/configure index b6c44d22..74657d2d 100755 --- a/configure +++ b/configure @@ -56,7 +56,7 @@ if test -e '.git' ; then : fi fi # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for OCaml 4.11.0. +# Generated by GNU Autoconf 2.69 for OCaml 4.11.1. # # Report bugs to . # @@ -646,8 +646,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='OCaml' PACKAGE_TARNAME='ocaml' -PACKAGE_VERSION='4.11.0' -PACKAGE_STRING='OCaml 4.11.0' +PACKAGE_VERSION='4.11.1' +PACKAGE_STRING='OCaml 4.11.1' PACKAGE_BUGREPORT='caml-list@inria.fr' PACKAGE_URL='http://www.ocaml.org' @@ -1482,7 +1482,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures OCaml 4.11.0 to adapt to many kinds of systems. +\`configure' configures OCaml 4.11.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1548,7 +1548,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of OCaml 4.11.0:";; + short | recursive ) echo "Configuration of OCaml 4.11.1:";; esac cat <<\_ACEOF @@ -1711,7 +1711,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -OCaml configure 4.11.0 +OCaml configure 4.11.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2374,7 +2374,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by OCaml $as_me 4.11.0, which was +It was created by OCaml $as_me 4.11.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2723,8 +2723,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring OCaml version 4.11.0" >&5 -$as_echo "$as_me: Configuring OCaml version 4.11.0" >&6;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring OCaml version 4.11.1" >&5 +$as_echo "$as_me: Configuring OCaml version 4.11.1" >&6;} # Configuration variables @@ -2800,7 +2800,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. -VERSION=4.11.0 +VERSION=4.11.1 # Note: This is present for the flexdll bootstrap where it exposed as the old @@ -12475,7 +12475,7 @@ case $ocaml_cv_cc_vendor in #( *) : outputobj='-o $(EMPTY)' gcc_warnings='-Wall -Wdeclaration-after-statement' - case 4.11.0 in #( + case 4.11.1 in #( *+dev*) : gcc_warnings="$gcc_warnings -Werror" ;; #( *) : @@ -16893,7 +16893,7 @@ else ocamldoc=ocamldoc fi -case $enable_ocamltest,4.11.0 in #( +case $enable_ocamltest,4.11.1 in #( yes,*|,*+dev*) : ocamltest='ocamltest' ;; #( *) : @@ -17610,7 +17610,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by OCaml $as_me 4.11.0, which was +This file was extended by OCaml $as_me 4.11.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -17677,7 +17677,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -OCaml config.status 4.11.0 +OCaml config.status 4.11.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/ocaml-variants.opam b/ocaml-variants.opam index 693432ea..f6b0abc8 100644 --- a/ocaml-variants.opam +++ b/ocaml-variants.opam @@ -1,8 +1,8 @@ opam-version: "2.0" -version: "4.11.0" -synopsis: "OCaml development version" +version: "4.11.1" +synopsis: "OCaml 4.11.1, official release" depends: [ - "ocaml" {= "4.11.0" & post} + "ocaml" {= "4.11.1" & post} "base-unix" {post} "base-bigarray" {post} "base-threads" {post} diff --git a/testsuite/tests/typing-misc/labels.ml b/testsuite/tests/typing-misc/labels.ml index 5192f411..62e1c07b 100644 --- a/testsuite/tests/typing-misc/labels.ml +++ b/testsuite/tests/typing-misc/labels.ml @@ -90,3 +90,32 @@ Line 1, characters 45-46: Warning 19: commuted an argument without principality. val f : (x:int -> unit -> int) -> x:int -> int = |}];; + +(* 9859: inferred function types may appear in the right hand side of :> *) +class setup = object + method with_ f = (f 0:unit) +end +class virtual fail = object (self) + method trigger = (self :> setup ) +end +[%%expect {| +class setup : object method with_ : (int -> unit) -> unit end +class virtual fail : + object + method trigger : setup + method virtual with_ : (int -> unit) -> unit + end +|}] + +module type T = sig type t end +let type_of (type x) (x: x) = (module struct type t = x end: T with type t = x) +let f g = 1 + g ~x:0 ~y:0;; +module E = (val type_of f) +let g = ( (fun _ -> f) :> 'a -> E.t) +[%%expect {| +module type T = sig type t end +val type_of : 'x -> (module T with type t = 'x) = +val f : (x:int -> y:int -> int) -> int = +module E : sig type t = (x:int -> y:int -> int) -> int end +val g : 'a -> E.t = +|}] diff --git a/testsuite/tests/typing-poly/poly.ml b/testsuite/tests/typing-poly/poly.ml index 88930a59..655a1ee9 100644 --- a/testsuite/tests/typing-poly/poly.ml +++ b/testsuite/tests/typing-poly/poly.ml @@ -1852,3 +1852,27 @@ Error: This expression has type < x : 'b. 'b s list > 'a list The universal variable 'b would escape its scope |}] + +(* #9856 *) +let f x = + let ref : type a . a option ref = ref None in + ref := Some x; + Option.get !ref +[%%expect{| +Line 2, characters 6-44: +2 | let ref : type a . a option ref = ref None in + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Error: This definition has type 'a option ref which is less general than + 'a0. 'a0 option ref +|}] + +type pr = { foo : 'a. 'a option ref } +let x = { foo = ref None } +[%%expect{| +type pr = { foo : 'a. 'a option ref; } +Line 2, characters 16-24: +2 | let x = { foo = ref None } + ^^^^^^^^ +Error: This field value has type 'b option ref which is less general than + 'a. 'a option ref +|}] diff --git a/typing/ctype.ml b/typing/ctype.ml index 10330976..826b048a 100644 --- a/typing/ctype.ml +++ b/typing/ctype.ml @@ -3999,8 +3999,7 @@ let rec build_subtype env visited loops posi level t = (t, Unchanged) else (t, Unchanged) - | Tarrow(l, t1, t2, com) -> - assert (com = Cok); + | Tarrow(l, t1, t2, _) -> if memq_warn t visited then (t, Unchanged) else let visited = t :: visited in let (t1', c1) = build_subtype env visited loops (not posi) level t1 in diff --git a/typing/typecore.ml b/typing/typecore.ml index 995ee91a..4b2ce97c 100644 --- a/typing/typecore.ml +++ b/typing/typecore.ml @@ -4978,7 +4978,9 @@ and type_let so we do it anyway. *) generalize exp.exp_type | Some vars -> - generalize_and_check_univars env "definition" exp pat.pat_type vars) + if maybe_expansive exp then + lower_contravariant env exp.exp_type; + generalize_and_check_univars env "definition" exp pat.pat_type vars) pat_list exp_list; let l = List.combine pat_list exp_list in let l =