diff options
author | Jacques Garrigue <garrigue at math.nagoya-u.ac.jp> | 2003-11-18 10:50:04 +0000 |
---|---|---|
committer | Jacques Garrigue <garrigue at math.nagoya-u.ac.jp> | 2003-11-18 10:50:04 +0000 |
commit | 503c29e317ed4dd52f8a4c9632934a88dd728213 (patch) | |
tree | 4da66948ffaa7877c3fd822214fd5f56e2069844 | |
parent | 2e45c47407402e9240db5a08300252c07abb1953 (diff) | |
download | ocaml-503c29e317ed4dd52f8a4c9632934a88dd728213.tar.gz |
immediate objects are final classes
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/fastclass@5928 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r-- | typing/typeclass.ml | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/typing/typeclass.ml b/typing/typeclass.ml index e52549f63f..b22cd05f00 100644 --- a/typing/typeclass.ml +++ b/typing/typeclass.ml @@ -588,7 +588,7 @@ and class_structure cl_num final val_env met_env loc (spat, str) = been modified yet. self_type will not change after this point *) List.iter (fun (lab,kind,ty) -> if lab <> dummy_method then - try prerr_endline lab; Ctype.unify val_env public_self + try Ctype.unify val_env public_self (Ctype.newty (Tobject (Ctype.newty @@ -1324,16 +1324,15 @@ let type_object env loc s = incr class_num; let (desc, sign) = class_structure (string_of_int !class_num) true env env loc s in - let sty = sign.cty_self in - let sign = {sign with cty_self = Ctype.expand_head env sty} in - begin match virtual_methods sign with + let sty = Ctype.expand_head env sign.cty_self in + begin match virtual_methods {sign with cty_self = sty} with [] -> () | mets -> raise(Error(loc, Virtual_class(true, mets))) end; - Ctype.hide_private_methods sign.cty_self; - let (fields, _) = Ctype.flatten_fields (Ctype.object_fields sign.cty_self) in + Ctype.hide_private_methods sty; + let (fields, _) = Ctype.flatten_fields (Ctype.object_fields sty) in let meths = List.map (fun (s,_,_) -> s) fields in - unify_parents_struct env sty desc; + unify_parents_struct env sign.cty_self desc; (desc, sign, meths) let () = |