Support record spreads in inline records
This allows you to use record spreads in inline records. It's mostly for consistency, record spreads are less useful in inline records because you can't get a hold of the type and coerce it to the underlying type definition. But, it's still useful to be able to spread into the inline record so you can share type definitions.
There's currently an outstanding parser issue I'd like to tackle in this PR as well. The issue is that you can't have just a single spread as the full inline record body. That would be useful to have. One example (that now doesn't parse) of a use case is this:
// Directive nodes can appear both standalone and as part of the ast variant
// Simplified type definition just for examplifying
type directiveNode = {
name: string,
loc: Location.t,
payload?: payload
}
// directiveNode can appear both as
@tag("kind") type astNode = ObjectNode({ name: string, directives: array<directiveNode> }) | DirectiveNode({...directiveNode})
This pull request 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 would be good to have, but might be worth just starting over.
This pull request 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.
Will need to be redone if still relevant.