Skip to content

Commit

Permalink
fix PR#3638
Browse files Browse the repository at this point in the history
git-svn-id: http://caml.inria.fr/svn/ocaml/version/3.08@6968 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
  • Loading branch information
Jacques Garrigue committed Jul 12, 2005
1 parent 235dc05 commit febf67d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions typing/typeclass.ml
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,11 @@ and class_signature env sty sign =

(* Check that the binder is a correct type, and introduce a dummy
method preventing self type from being closed. *)
let dummy_obj = Ctype.newvar () in
Ctype.unify env (Ctype.filter_method env dummy_method Private dummy_obj)
(Ctype.newty (Ttuple []));
begin try
Ctype.unify env
(Ctype.filter_method env dummy_method Private self_type)
(Ctype.newty (Ttuple []))
Ctype.unify env self_type dummy_obj
with Ctype.Unify _ ->
raise(Error(sty.ptyp_loc, Pattern_type_clash self_type))
end;
Expand Down

0 comments on commit febf67d

Please sign in to comment.