Skip to content

Conversation

zth
Copy link
Member

@zth zth commented Jul 10, 2023

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})

@zth zth mentioned this pull request Jul 16, 2023
6 tasks
@zth zth requested a review from cristianoc July 30, 2023 19:29
@zth zth marked this pull request as ready for review July 30, 2023 19:29
@zth zth changed the title [WIP] support record spreads in inline records Support record spreads in inline records Jul 30, 2023
@zth zth force-pushed the inline-record-spreads branch 2 times, most recently from 8c40be7 to eec78ab Compare July 31, 2023 10:27
@zth zth force-pushed the inline-record-spreads branch from eec78ab to 21731b1 Compare August 8, 2023 11:33
Copy link

github-actions bot commented Sep 7, 2024

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.

@github-actions github-actions bot added the stale Old issues that went stale label Sep 7, 2024
@zth
Copy link
Member Author

zth commented Sep 7, 2024

This would be good to have, but might be worth just starting over.

@github-actions github-actions bot removed the stale Old issues that went stale label Sep 8, 2024
Copy link

github-actions bot commented Sep 3, 2025

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.

@github-actions github-actions bot added the stale Old issues that went stale label Sep 3, 2025
@zth
Copy link
Member Author

zth commented Sep 3, 2025

Will need to be redone if still relevant.

@zth zth closed this Sep 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale Old issues that went stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant