File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -98,12 +98,13 @@ type aenv = {
9898}
9999
100100and acache = {
101- op : Sp .t ; (* Operator declaration already handled *)
101+ op : Sp .t ; (* Operator declaration already handled *)
102+ type_ : Sp .t ; (* Type declaration already handled *)
102103}
103104
104105(* -------------------------------------------------------------------- *)
105106let empty_acache : acache =
106- { op = Sp. empty; }
107+ { op = Sp. empty; type_ = Sp. empty; }
107108
108109(* -------------------------------------------------------------------- *)
109110let mkaenv (env : EcEnv.env ) (cb : cb ) : aenv =
@@ -154,9 +155,18 @@ and on_ty (aenv : aenv) (ty : ty) =
154155 | Tvar _ -> ()
155156 | Tglob _ -> ()
156157 | Ttuple tys -> List. iter (on_ty aenv) tys
157- | Tconstr (p , tys ) -> aenv.cb ( `Type p) ; List. iter (on_ty aenv) tys
158+ | Tconstr (p , tys ) -> on_tyname aenv p ; List. iter (on_ty aenv) tys
158159 | Tfun (ty1 , ty2 ) -> List. iter (on_ty aenv) [ty1; ty2]
159160
161+ (* -------------------------------------------------------------------- *)
162+ and on_tyname (aenv : aenv ) (p : path ) =
163+ aenv.cb (`Type p);
164+ if not (Sp. mem p ! (aenv.cache).type_) then begin
165+ let cache = { ! (aenv.cache) with type_ = Sp. add p ! (aenv.cache).type_ } in
166+ aenv.cache := cache;
167+ on_tydecl aenv (EcEnv.Ty. by_path p aenv.env)
168+ end
169+
160170(* -------------------------------------------------------------------- *)
161171and on_opname (aenv : aenv ) (p : EcPath.path ) =
162172 aenv.cb (`Op p);
You can’t perform that action at this time.
0 commit comments