From 4fdba2f638d5ab40e1c6149e98488bd507f0eaf0 Mon Sep 17 00:00:00 2001 From: Florian Angeletti Date: Fri, 10 Jan 2020 09:47:41 +0100 Subject: Merge pull request #9185 from hhugo/fix-unused-open fix spurious 'unused open' warning with classes and polymorphic variants (cherry picked from commit d2c4e791fad6340c74abf741af3e79eb1f9c20d7) --- typing/typetexp.ml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'typing/typetexp.ml') 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, -- cgit v1.2.1