rescript-compiler
rescript-compiler copied to clipboard
Compiler doesn't prevent from spreading object types in a record type
Originally discovered by a post on the forum, you can do this today:
type baseProps = {"name": string}
type props = {
...baseProps,
label: string,
}
let label: props = {
"name": "hello",
"label": "label",
}
The compiler would not complain (tested with versions v11.0.0 to v11.1.1), type props here looks like a record type but is actually an object type.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This is still the case.