Skip to content

Commit e688272

Browse files
committed
add more fields to test
1 parent b6b1dfb commit e688272

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

jscomp/test/DictInternalRepresentation.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/test/DictTests.js

Lines changed: 14 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/test/DictTests.res

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ let intDict = dict{
1818
module PatternMatching = {
1919
let inferDictByPattern = dict =>
2020
switch dict {
21-
| @res.dictPattern {one: 1} =>
22-
let _d: dict<int> = dict
23-
Js.log("one")
21+
| @res.dictPattern {one: 1, three: 3, four: 4} =>
22+
// Make sure that the dict is of correct type
23+
dict->Js.Dict.set("five", 5)
24+
| @res.dictPattern {two: 1} => Js.log("two")
2425
| _ => Js.log("not one")
2526
}
2627

0 commit comments

Comments
 (0)