fix: proper shims for CCArrayLabel too

This commit is contained in:
Simon Cruanes 2019-12-11 08:55:20 -06:00
parent d5e5b43e1f
commit 616c077880
3 changed files with 19 additions and 6 deletions

View file

@ -16,10 +16,7 @@ type 'a printer = Format.formatter -> 'a -> unit
external make_float : int -> float array = "caml_make_float_vect" (* compat *)
(**/**)
include module type of ArrayLabels
type 'a t = 'a array
(** The type for arrays *)
include module type of CCShimsArrayLabels_
val empty : 'a t
(** [empty] is the empty array, physically equal to [||]. *)

View file

@ -6,7 +6,7 @@
(rule
(targets CCShims_.ml CCShimsList_.ml CCShimsFun_.ml CCShimsFun_.mli
CCShimsArray_.ml CCShimsFormat_.ml CCShimsMkLet_.ml)
CCShimsArray_.ml CCShimsFormat_.ml CCShimsMkLet_.ml CCShimsArrayLabels_.ml)
(deps ./mkshims.exe)
(action
(run ./mkshims.exe)))

View file

@ -76,7 +76,18 @@ let shims_list_post_408 = "include List"
let shims_array_pre_406 = "
include Array
module Floatarray = struct end
module Floatarray = struct type t = float array end
type 'a t = 'a array
"
let shims_array_label_pre_406 = "
include ArrayLabels
module Floatarray = struct type t = float array end
type 'a t = 'a array
"
let shims_array_label_406_408 = "
include ArrayLabels
type 'a t = 'a array
"
@ -85,6 +96,7 @@ let shims_array_406_408 = "
type 'a t = 'a array
"
let shims_array_post_408 = "include Array"
let shims_array_label_post_408 = "include ArrayLabels"
let shims_let_op_pre_408 =
"
@ -148,6 +160,10 @@ let () =
(if (major, minor) >= (4,8) then shims_array_post_408
else if (major, minor) >= (4,6) then shims_array_406_408
else shims_array_pre_406);
write_file "CCShimsArrayLabels_.ml"
(if (major, minor) >= (4,8) then shims_array_label_post_408
else if (major, minor) >= (4,6) then shims_array_label_406_408
else shims_array_label_pre_406);
write_file "CCShimsFormat_.ml" (if (major, minor) >= (4,8) then shims_fmt_post_408 else shims_fmt_pre_408);
write_file "CCShimsFun_.ml" (if (major, minor) >= (4,8) then shims_fun_post_408 else shims_fun_pre_408);
write_file "CCShimsFun_.mli" (if (major, minor) >= (4,8) then shims_fun_mli_post_408 else shims_fun_mli_pre_408);