Skip to content

Commit 555792d

Browse files
committed
Include Tsubst and Tpoly
1 parent 8924660 commit 555792d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

tools/src/tools.ml

+10-1
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ let path_to_string path =
381381
let valueDetail (typ : Types.type_expr) =
382382
let rec collectSignatureTypes (typ_desc : Types.type_desc) =
383383
match typ_desc with
384-
| Tlink t -> collectSignatureTypes t.desc
384+
| Tlink t | Tsubst t -> collectSignatureTypes t.desc
385385
| Tconstr (Path.Pident {name = "function$"}, [t; _], _) ->
386386
collectSignatureTypes t.desc
387387
| Tconstr (path, ts, _) -> (
@@ -398,6 +398,15 @@ let valueDetail (typ : Types.type_expr) =
398398
| Tarrow (_, t1, t2, _) ->
399399
collectSignatureTypes t1.desc @ collectSignatureTypes t2.desc
400400
| Tvar None -> [{path = "_"; genericParameters = []}]
401+
| Tpoly (t, ts) -> (
402+
let genericParameters =
403+
List.concat_map
404+
(fun (t : Types.type_expr) -> collectSignatureTypes t.desc)
405+
ts
406+
in
407+
match collectSignatureTypes t.desc with
408+
| [{path; genericParameters = []}] -> [{path; genericParameters}]
409+
| rest -> rest @ genericParameters)
401410
| _ -> []
402411
in
403412
match collectSignatureTypes typ.desc with

0 commit comments

Comments
 (0)