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.
Examples run in the playground, with v11.1.0.
Consider the following snippet:
Pasting this example code into the playground successfully compiles, but with a warning:
Yet, if we remove this 'unused' open,
we get a compiler error (as expected by module scoping)
Interestingly, the warning disappears if remove the value field:
or pass a value for it:
The text was updated successfully, but these errors were encountered: