compatibilities

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7624 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Jacques Garrigue 2006-09-21 07:51:11 +00:00
parent c28863124b
commit e3368f2f17
1 changed files with 18 additions and 0 deletions

View File

@ -96,3 +96,21 @@ module Mix(X:T)(Y:T with type t = private [> ] ~ [X.t]) :
(* deep *)
module M : sig type t = private [> ] ~ [`A] end = struct type t = [`A] end
module M' : sig type t = private [> ] end = struct type t = [M.t | `A] end;;
(* parameters *)
module type T = sig
type t = private [> ] ~ [ `A of int ]
type ('a,'b) u = private [> ] ~ [ `A of 'a; `A of 'b; `B of 'b ]
type v = private [> ] ~ [ `A of int; `A of bool ]
end
module F(X:T) = struct
let h = function
`A _ -> true
| #X.t -> false
let f = function
`A _ | `B _ -> true
| #X.u -> false
let g = function
`A _ -> true
| #X.v -> false
end