summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlain Frisch <alain@frisch.fr>2014-09-29 14:06:20 +0000
committerAlain Frisch <alain@frisch.fr>2014-09-29 14:06:20 +0000
commit6ca707d0665b2015a5690de8c560e27f6371e443 (patch)
tree116dbd382d743731e64fbad30c366aae056b3807
parente8fd41e2e833bf2d057c1bb6f14fe19d0960f24f (diff)
downloadocaml-constructors_with_record3.tar.gz
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15368 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--typing/env.ml35
1 files changed, 0 insertions, 35 deletions
diff --git a/typing/env.ml b/typing/env.ml
index fe1eee1cdb..5b89b0bd99 100644
--- a/typing/env.ml
+++ b/typing/env.ml
@@ -860,41 +860,6 @@ let lookup_constructor lid env =
use ();
desc
-(*
-let lookup_constructor lid env =
- match Longident.split_lident lid with
- | None -> lookup_constructor lid env
- | Some (ty_id, cstr_id) ->
- let (ty_path, ty_decl) = lookup_type ty_id env in
- match ty_decl.type_kind with
- | Type_variant _ ->
- let (cstrs, _, _) = find_type_descrs ty_path env in
- begin match cstr_id with
- | Lident s ->
- List.find (fun c -> c.cstr_name = s) cstrs
- | _ ->
- failwith "Type %s is a regular variant type: constructor name must be local"
- end
- | Type_open ->
- let cstrs = lookup_all_constructors cstr_id env in
- let (c, use) =
- try
- List.find
- (fun (c, _) ->
- match (repr c.cstr_res).desc with
- | Tconstr(p, _, _) -> Path.same ty_path p
- | _ -> false
- )
- cstrs
- with Not_found ->
- failwith "No constructor with qualified name %s found in type %s"
- in
- use ();
- c
- | _ ->
- failwith "Type %s is not a variant type"
-*)
-
let is_lident = function
Lident _ -> true
| _ -> false