@@ -1059,7 +1059,10 @@ let rec extractObjectType ~env ~package (t : Types.type_expr) =
1059
1059
| Tobject (tObj , _ ) -> Some (env, tObj)
1060
1060
| Tconstr (path , typeArgs , _ ) -> (
1061
1061
match References. digConstructor ~env ~package path with
1062
- | Some (env , {item = {decl = {type_manifest = Some t1 ; type_params = typeParams } } } ) ->
1062
+ | Some
1063
+ ( env,
1064
+ {item = {decl = {type_manifest = Some t1; type_params = typeParams}}}
1065
+ ) ->
1063
1066
let t1 = t1 |> instantiateType ~type Params ~type Args in
1064
1067
extractObjectType ~env ~package t1
1065
1068
| _ -> None )
@@ -1072,7 +1075,11 @@ let extractFunctionType ~env ~package typ =
1072
1075
| Tarrow (label , tArg , tRet , _ ) -> loop ~env ((label, tArg) :: acc) tRet
1073
1076
| Tconstr (path , typeArgs , _ ) -> (
1074
1077
match References. digConstructor ~env ~package path with
1075
- | Some (env , {item = {decl = {type_manifest = Some t1 ; type_params = typeParams } } } ) ->
1078
+ | Some
1079
+ ( env,
1080
+ {
1081
+ item = {decl = {type_manifest = Some t1; type_params = typeParams}};
1082
+ } ) ->
1076
1083
let t1 = t1 |> instantiateType ~type Params ~type Args in
1077
1084
loop ~env acc t1
1078
1085
| _ -> (List. rev acc, t))
@@ -1731,9 +1738,18 @@ Note: The `@react.component` decorator requires the react-jsx config to be set i
1731
1738
| Tarrow ((Labelled l | Optional l ), tArg , tRet , _ ) ->
1732
1739
(l, tArg) :: getLabels ~env tRet
1733
1740
| Tarrow (Nolabel, _ , tRet , _ ) -> getLabels ~env tRet
1734
- | Tconstr (path , _ , _ ) -> (
1741
+ | Tconstr (path , typeArgs , _ ) -> (
1735
1742
match References. digConstructor ~env ~package path with
1736
- | Some (env , {item = {decl = {type_manifest = Some t1 } } } ) ->
1743
+ | Some
1744
+ ( env,
1745
+ {
1746
+ item =
1747
+ {
1748
+ decl =
1749
+ {type_manifest = Some t1; type_params = typeParams};
1750
+ };
1751
+ } ) ->
1752
+ let t1 = t1 |> instantiateType ~type Params ~type Args in
1737
1753
getLabels ~env t1
1738
1754
| _ -> [] )
1739
1755
| _ -> []
0 commit comments