Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/ml/parmatch.ml
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,7 @@ let extract_fields omegas arg =

let all_record_args lbls =
match lbls with
| [] -> []
| (_, {lbl_all}, _, opt) :: _ ->
let t =
Array.map
Expand Down Expand Up @@ -560,7 +561,6 @@ let all_record_args lbls =
t.(lbl.lbl_pos) <- x)
lbls;
Array.to_list t
| _ -> fatal_error "Parmatch.all_record_args"

(* Build argument list when p2 >= p1, where p1 is a simple pattern *)
let rec simple_match_args p1 p2 =
Expand Down
13 changes: 13 additions & 0 deletions tests/tests/src/parmatch_empty_record_pattern_test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Generated by ReScript, PLEASE EDIT WITH CARE


let match = {};

let emptyDictPatternShouldCompile;

emptyDictPatternShouldCompile = typeof match === "object" && match !== null && !Array.isArray(match);

export {
emptyDictPatternShouldCompile,
}
/* emptyDictPatternShouldCompile Not a pure module */
4 changes: 4 additions & 0 deletions tests/tests/src/parmatch_empty_record_pattern_test.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
let emptyDictPatternShouldCompile = switch JSON.Object(dict{}) {
| JSON.Object(dict{}) => true
| _ => false
}
Loading