Skip to content

Commit 1636515

Browse files
committedMay 26, 2024
set mode properly
1 parent ebb7739 commit 1636515

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed
 

‎analysis/src/Xform.ml

+5-3
Original file line numberDiff line numberDiff line change
@@ -406,11 +406,11 @@ module ExpandCatchAllForVariants = struct
406406
@ constructorNames
407407
| _ -> constructorNames
408408
in
409-
let getCurrentConstructorNames cases =
409+
let getCurrentConstructorNames ?mode cases =
410410
cases
411411
|> List.map (fun (c : Parsetree.case) ->
412412
if Option.is_some c.pc_guard then []
413-
else findAllConstructorNames ~mode:`option c.pc_lhs)
413+
else findAllConstructorNames ?mode c.pc_lhs)
414414
|> List.flatten
415415
in
416416
let currentConstructorNames = getCurrentConstructorNames cases in
@@ -481,7 +481,9 @@ module ExpandCatchAllForVariants = struct
481481
in
482482
match innerType with
483483
| Some ((Tvariant _ | Tpolyvariant _) as variant) ->
484-
let currentConstructorNames = getCurrentConstructorNames cases in
484+
let currentConstructorNames =
485+
getCurrentConstructorNames ~mode:`option cases
486+
in
485487
let hasNoneCase =
486488
cases
487489
|> List.exists (fun (c : Parsetree.case) ->

0 commit comments

Comments
 (0)