diff options
author | Jacques Garrigue <garrigue at math.nagoya-u.ac.jp> | 2003-03-26 08:23:33 +0000 |
---|---|---|
committer | Jacques Garrigue <garrigue at math.nagoya-u.ac.jp> | 2003-03-26 08:23:33 +0000 |
commit | d385c34635092b35cfce8b11830569a6befe7e84 (patch) | |
tree | 0daa3bae618cdd1bf478d3988e65e5935f581a68 | |
parent | 2872acb145d70ef56ea3a27d218d43e8e1d6bfb2 (diff) |
bug fixes
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5460 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r-- | testlabl/poly.exp | 7 | ||||
-rw-r--r-- | testlabl/poly.exp2 | 7 | ||||
-rw-r--r-- | testlabl/poly.ml | 15 |
3 files changed, 29 insertions, 0 deletions
diff --git a/testlabl/poly.exp b/testlabl/poly.exp index de72c210c..f2005cb5d 100644 --- a/testlabl/poly.exp +++ b/testlabl/poly.exp @@ -218,4 +218,11 @@ This field value has type 'a option ref option which is less general than # class c : object method m : ([> 'a t ] as 'a) -> unit end # class c : object method m : ([> 'a t ] as 'a) -> 'a end # class c : object method m : ([> `A ] as 'a) option -> 'a end +# Characters 149-151: +This type 'a should be an instance of type 'b +The universal variable 'a would escape its scope +# type ('a, 'b) list_visitor = < caseCons : 'b -> 'b list -> 'a; caseNil : 'a > +type 'a alist = < visit : 'b. ('b, 'a) list_visitor -> 'b > +class type ct = object ('a) method fold : ('b -> 'a -> 'b) -> 'b -> 'b end +type t = { f : 'a 'b. ('b -> (#ct as 'a) -> 'b) -> 'b; } # diff --git a/testlabl/poly.exp2 b/testlabl/poly.exp2 index d7444d1b9..d4e0ff8ab 100644 --- a/testlabl/poly.exp2 +++ b/testlabl/poly.exp2 @@ -225,4 +225,11 @@ This field value has type 'a option ref option which is less general than # class c : object method m : ([> 'a t ] as 'a) -> unit end # class c : object method m : ([> 'a t ] as 'a) -> 'a end # class c : object method m : ([> `A ] as 'a) option -> 'a end +# Characters 149-151: +This type 'a should be an instance of type 'b +The universal variable 'a would escape its scope +# type ('a, 'b) list_visitor = < caseCons : 'b -> 'b list -> 'a; caseNil : 'a > +type 'a alist = < visit : 'b. ('b, 'a) list_visitor -> 'b > +class type ct = object ('a) method fold : ('b -> 'a -> 'b) -> 'b -> 'b end +type t = { f : 'a 'b. ('b -> (#ct as 'a) -> 'b) -> 'b; } # diff --git a/testlabl/poly.ml b/testlabl/poly.ml index c3116bd64..e5e5c28d9 100644 --- a/testlabl/poly.ml +++ b/testlabl/poly.ml @@ -367,3 +367,18 @@ end;; (* usage avant instance *) class c = object method m : 'a. 'a option -> ([> `A] as 'a) = fun x -> `A end;; + +(* various old bugs *) +class virtual ['a] visitor = +object method virtual caseNil : 'a end +and virtual int_list = +object method virtual visit : 'a.('a visitor -> 'a) end;; + +type ('a,'b) list_visitor = < caseNil : 'a; caseCons : 'b -> 'b list -> 'a > +type 'b alist = < visit : 'a. ('a,'b) list_visitor -> 'a > + +(* PR#1607 *) +class type ct = object ('s) + method fold : ('b -> 's -> 'b) -> 'b -> 'b +end +type t = {f : 'a 'b. ('b -> (#ct as 'a) -> 'b) -> 'b};; |