You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When disambiguating record types, there's a check that all the labels are supplied when constructing a record.
While not supplying all the labels is supported in case of optional labels, the order of disambiguation is affected by the presence of optional labels.
Example:
```res
type t1 = {x:int, y:int}
type t2 = {x:int, y:int, z?:int}
let v = {x:3, y:4}
```
Currently `v` has type `t1`, while it's perfectly fine for it to have type `t2`.
In particular, the normal shadowing behaviour that applies without optional labels, does not happen. (If you remove `z` from the second type definition, then the normal shadowing happens, and `v` gets type `t2`.
This wip changes the disambiguation so that supplying at least all the mandatory labels is enough in disambiguation.
The change also addresses the issue #6752 of spurious warning of unused open.
# Conflicts:
# CHANGELOG.md
# jscomp/test/build.ninja
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,7 @@
16
16
17
17
- Fix location of let bindings with attributes. https://github.com/rescript-lang/rescript-compiler/pull/6791
18
18
- PPX v4: mark props type in externals as `@live` to avoid dead code warnings for prop fields in the editor tooling. https://github.com/rescript-lang/rescript-compiler/pull/6796
19
+
- Fix issue where optional labels were not taken into account when disambiguating record value construction. https://github.com/rescript-lang/rescript-compiler/pull/6798
0 commit comments