diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 1996-10-01 09:47:18 +0000 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 1996-10-01 09:47:18 +0000 |
commit | c540d67fde905415799558189b908c9bf4770ec2 (patch) | |
tree | 8f0a8236afc0f924d0103d6aa31d545e5ffe81ef /typing | |
parent | 74a434c4a0331aeabb2ba37918130f2034bb8aff (diff) | |
download | ocaml-c540d67fde905415799558189b908c9bf4770ec2.tar.gz |
Deplacement d'un try...with dans expand_abbrev.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1041 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'typing')
-rw-r--r-- | typing/ctype.ml | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/typing/ctype.ml b/typing/ctype.ml index b7f07cd012..3bc5420b55 100644 --- a/typing/ctype.ml +++ b/typing/ctype.ml @@ -352,22 +352,20 @@ let expand_abbrev env path args abbrev level = update_level level ty; ty | None -> - try - let decl = Env.find_type path env in - match decl.type_manifest with - Some body -> - let v = newvar () in - abbrev := (path, v)::!abbrev; - let old_level = !current_level in - current_level := level; - let ty = substitute !abbrev decl.type_params args body in - current_level := old_level; - v.desc <- Tlink ty; - ty - | _ -> - raise Cannot_expand - with Not_found -> - raise Cannot_expand + let decl = + try Env.find_type path env with Not_found -> raise Cannot_expand in + match decl.type_manifest with + Some body -> + let v = newvar () in + abbrev := (path, v)::!abbrev; + let old_level = !current_level in + current_level := level; + let ty = substitute !abbrev decl.type_params args body in + current_level := old_level; + v.desc <- Tlink ty; + ty + | _ -> + raise Cannot_expand let rec expand_root env ty = let ty = repr ty in |