summaryrefslogtreecommitdiff
path: root/typing/typetexp.ml
diff options
context:
space:
mode:
authorFlorian Angeletti <florian.angeletti@inria.fr>2020-01-10 09:47:41 +0100
committerFlorian Angeletti <florian.angeletti@inria.fr>2020-01-10 09:49:02 +0100
commit4fdba2f638d5ab40e1c6149e98488bd507f0eaf0 (patch)
treef358a9b2eb1810e4e5243273dfee9440f034104f /typing/typetexp.ml
parent8d8e991cedeef372ca029625fc4680572f2c4048 (diff)
downloadocaml-4fdba2f638d5ab40e1c6149e98488bd507f0eaf0.tar.gz
Merge pull request #9185 from hhugo/fix-unused-open
fix spurious 'unused open' warning with classes and polymorphic variants (cherry picked from commit d2c4e791fad6340c74abf741af3e79eb1f9c20d7)
Diffstat (limited to 'typing/typetexp.ml')
-rw-r--r--typing/typetexp.ml4
1 files changed, 3 insertions, 1 deletions
diff --git a/typing/typetexp.ml b/typing/typetexp.ml
index d886928fd2..a55e53d00a 100644
--- a/typing/typetexp.ml
+++ b/typing/typetexp.ml
@@ -266,6 +266,7 @@ and transl_type_aux env policy styp =
in check decl;
Location.deprecated styp.ptyp_loc
"old syntax for polymorphic variant type";
+ ignore(Env.lookup_type ~loc:lid.loc lid.txt env);
(path, decl,true)
with Not_found -> try
let lid2 =
@@ -275,9 +276,10 @@ and transl_type_aux env policy styp =
| Longident.Lapply(_, _) -> fatal_error "Typetexp.transl_type"
in
let path, decl = Env.find_type_by_name lid2 env in
+ ignore(Env.lookup_cltype ~loc:lid.loc lid.txt env);
(path, decl, false)
with Not_found ->
- ignore (Env.lookup_class ~loc:lid.loc lid.txt env); assert false
+ ignore (Env.lookup_cltype ~loc:lid.loc lid.txt env); assert false
in
if List.length stl <> decl.type_arity then
raise(Error(styp.ptyp_loc, env,