@@ -1780,7 +1780,7 @@ let rec resolveNestedPattern typ ~env ~package ~nested =
1780
1780
| Some {typ} -> typ |> resolveNestedPattern ~env ~package ~nested )
1781
1781
| PRecordBody {seenFields} , Some (Trecord {env; typeExpr} ) ->
1782
1782
Some (typeExpr, env, Some (Completable. RecordField {seenFields}))
1783
- | PVariantPayload {constructorName}, Some (Tvariant {env; constructors})
1783
+ | PVariantPayload {constructorName; itemNum }, Some (Tvariant {env; constructors})
1784
1784
-> (
1785
1785
match
1786
1786
constructors
@@ -1789,15 +1789,10 @@ let rec resolveNestedPattern typ ~env ~package ~nested =
1789
1789
with
1790
1790
| None -> None
1791
1791
| Some constructor -> (
1792
- let payloadNum, nested =
1793
- match nested with
1794
- | PTupleItem {itemNum} :: nested -> (itemNum, nested)
1795
- | _ -> (0 , nested)
1796
- in
1797
- match List. nth_opt constructor.args payloadNum with
1792
+ match List. nth_opt constructor.args itemNum with
1798
1793
| None -> None
1799
1794
| Some (typ , _ ) -> typ |> resolveNestedPattern ~env ~package ~nested ))
1800
- | ( PPolyvariantPayload {constructorName},
1795
+ | ( PPolyvariantPayload {constructorName; itemNum },
1801
1796
Some (Tpolyvariant {env; constructors}) ) -> (
1802
1797
match
1803
1798
constructors
@@ -1806,12 +1801,7 @@ let rec resolveNestedPattern typ ~env ~package ~nested =
1806
1801
with
1807
1802
| None -> None
1808
1803
| Some constructor -> (
1809
- let payloadNum, nested =
1810
- match nested with
1811
- | PTupleItem {itemNum} :: nested -> (itemNum, nested)
1812
- | _ -> (0 , nested)
1813
- in
1814
- match List. nth_opt constructor.args payloadNum with
1804
+ match List. nth_opt constructor.args itemNum with
1815
1805
| None -> None
1816
1806
| Some typ -> typ |> resolveNestedPattern ~env ~package ~nested ))
1817
1807
| PArray , Some (Tarray (env , typ )) ->
0 commit comments