Skip to content

Commit 640f2f4

Browse files
committedOct 11, 2022
Fix issue where an empty record literal {} expected to have a non-record type would type check
Fixes #5728
1 parent 2d5aa72 commit 640f2f4

File tree

6 files changed

+13
-12
lines changed

6 files changed

+13
-12
lines changed
 

‎CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
- Fix printing of comments inside JSX tag https://github.com/rescript-lang/syntax/pull/664
3232
- Fix issue where formatter erases tail comments inside JSX tag https://github.com/rescript-lang/syntax/issues/663
3333
- Fix issue where the JSX prop has type annotation of the first class module https://github.com/rescript-lang/syntax/pull/666
34+
- Fix issue where an empty record literal {} expected to have a non-record type would type check
3435

3536
#### :eyeglasses: Spec Compliance
3637

‎jscomp/main/builtin_cmi_datasets.ml

+2-2
Large diffs are not rendered by default.

‎jscomp/ml/typecore.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2148,7 +2148,7 @@ and type_expect_ ?in_function ?(recarg=Rejected) env sexp ty_expected =
21482148
raise(Error(loc, env, Labels_missing labels_missing));
21492149
[||], representation
21502150
| [], _ ->
2151-
if fields = [] then
2151+
if fields = [] && repr_opt <> None then
21522152
[||], Record_optional_labels []
21532153
else
21542154
raise(Error(loc, env, Empty_record_literal)) in

‎lib/4.06.1/unstable/js_compiler.ml

+3-3
Large diffs are not rendered by default.

‎lib/4.06.1/unstable/js_playground_compiler.ml

+3-3
Large diffs are not rendered by default.

‎lib/4.06.1/whole_compiler.ml

+3-3
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)