File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -723,17 +723,19 @@ let rec tree_of_typexp = (sch, ty) => {
723723}
724724
725725and tree_of_typlist = (sch, tyl) => List . map(tree_of_typexp(sch), tyl)
726+ and get_arg_type = ty => {
727+ switch (ty. desc) {
728+ | TTyConstr (_ , [ ty ] , _ ) => ty
729+ | TTyLink (ty ) => get_arg_type(ty)
730+ | _ => failwith ("Impossible: optional argument with non-option type" )
731+ };
732+ }
726733and tree_of_argtyplist = (sch, al) =>
727734 List . map(
728735 ((l, ty)) => {
729736 let ty =
730737 switch (l) {
731- | Default (_ ) =>
732- switch (ty. desc) {
733- | TTyConstr (_ , [ ty ] , _ ) => ty
734- | _ =>
735- failwith ("Impossible: optional argument with non-option type" )
736- }
738+ | Default (_ ) => get_arg_type(ty)
737739 | _ => ty
738740 };
739741 (qualified_label_name(l), tree_of_typexp(sch, ty));
You can’t perform that action at this time.
0 commit comments