Skip to content

Commit 16fd1b7

Browse files
authored
Merge 11.0.1 changes into master (#6579)
1 parent 3bb11b4 commit 16fd1b7

28 files changed

+537
-166
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,18 @@
1212
1313
# 12.0.0-alpha.1 (Unreleased)
1414

15+
# 11.0.1
16+
17+
#### :bug: Bug Fix
18+
19+
- Renamed inline record fields: fix renamed field access in inline records. https://github.com/rescript-lang/rescript-compiler/pull/6551
20+
- Fixed issue with coercions sometimes raising a `Not_found` instead of giving a proper error message. https://github.com/rescript-lang/rescript-compiler/pull/6574
21+
- Fix issue with recursive modules and uncurried. https://github.com/rescript-lang/rescript-compiler/pull/6575
22+
23+
#### :nail_care: Polish
24+
25+
- Improve error message for missing label(s) in function application. https://github.com/rescript-lang/rescript-compiler/pull/6576
26+
1527
# 11.0.0
1628

1729
No changes compared to rc.9.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
We've found a bug for you!
3+
/.../fixtures/missing_label.res:3:9
4+
5+
1 │ let f = (~a) => a ++ ""
6+
2 │
7+
3 │ let _ = f("")
8+
4 │
9+
10+
Label ~a was omitted in the application of this labeled function.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
We've found a bug for you!
3+
/.../fixtures/missing_labels.res:3:9
4+
5+
1 │ let f = (~a, ~b) => a ++ b
6+
2 │
7+
3 │ let _ = f("", "")
8+
4 │
9+
10+
Labels ~a, ~b were omitted in the application of this labeled function.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
let f = (~a) => a ++ ""
2+
3+
let _ = f("")
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
let f = (~a, ~b) => a ++ b
2+
3+
let _ = f("", "")

jscomp/core/bs_conditional_initial.ml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@ let setup_env () =
4444
Builtin_attributes.check_bs_attributes_inclusion := Record_attributes_check.check_bs_attributes_inclusion;
4545
Builtin_attributes.check_duplicated_labels :=
4646
Record_attributes_check.check_duplicated_labels;
47-
Lambda.fld_record := Record_attributes_check.fld_record;
48-
Lambda.fld_record_set := Record_attributes_check.fld_record_set;
49-
Lambda.blk_record := Record_attributes_check.blk_record;
50-
Lambda.blk_record_inlined := Record_attributes_check.blk_record_inlined;
5147
Matching.names_from_construct_pattern :=
5248
Matching_polyfill.names_from_construct_pattern;
5349

jscomp/core/record_attributes_check.ml

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
type label = Types.label_description
2626

27-
let find_name = Matching.find_name
27+
let find_name = Lambda.find_name
2828

2929
let find_name_with_loc (attr : Parsetree.attribute) : string Asttypes.loc option
3030
=
@@ -40,34 +40,6 @@ let find_name_with_loc (attr : Parsetree.attribute) : string Asttypes.loc option
4040
Some { txt = s; loc }
4141
| _ -> None
4242

43-
let fld_record (lbl : label) =
44-
Lambda.Fld_record
45-
{
46-
name = Ext_list.find_def lbl.lbl_attributes find_name lbl.lbl_name;
47-
mutable_flag = lbl.lbl_mut;
48-
}
49-
50-
let fld_record_set (lbl : label) =
51-
Lambda.Fld_record_set
52-
(Ext_list.find_def lbl.lbl_attributes find_name lbl.lbl_name)
53-
54-
let blk_record (fields : (label * _) array) mut record_repr =
55-
let all_labels_info =
56-
Ext_array.map fields (fun (lbl, _) ->
57-
Ext_list.find_def lbl.lbl_attributes find_name lbl.lbl_name)
58-
in
59-
Lambda.Blk_record
60-
{ fields = all_labels_info; mutable_flag = mut; record_repr }
61-
62-
let blk_record_inlined fields name num_nonconst optional_labels ~tag ~attrs mutable_flag =
63-
let fields =
64-
Array.map
65-
(fun ((lbl : label), _) ->
66-
Ext_list.find_def lbl.lbl_attributes find_name lbl.lbl_name)
67-
fields
68-
in
69-
Lambda.Blk_record_inlined {fields; name; num_nonconst; tag; mutable_flag; optional_labels; attrs }
70-
7143
let check_bs_attributes_inclusion (attrs1 : Parsetree.attributes)
7244
(attrs2 : Parsetree.attributes) lbl_name =
7345
let a = Ext_list.find_def attrs1 find_name lbl_name in

jscomp/gentype_tests/typescript-react-example/package-lock.json

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

jscomp/gentype_tests/typescript-react-example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"lint": "eslint src"
1111
},
1212
"dependencies": {
13-
"@rescript/react": "^0.11.0",
13+
"@rescript/react": "^0.12.0",
1414
"react": "^18.2.0",
1515
"react-dom": "^18.2.0"
1616
},

jscomp/gentype_tests/typescript-react-example/src/Hooks.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ module ForwardRef = {
9999
)
100100
}
101101

102-
@genType type callback<'input, 'output> = React.callback<'input, 'output>
102+
@genType type callback<'input, 'output> = 'input => 'output
103103

104104
@genType type testReactContext = React.Context.t<int>
105105

0 commit comments

Comments
 (0)