Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(compiler): Record spread syntax #1565

Merged
merged 3 commits into from
Jan 7, 2023

Conversation

alex-snezhko
Copy link
Member

Syntax for creating a copy of a record while changing some field values. Currently the "naive" approach of copying fields one at a time is used, but bulk copying was discussed as a possible future improvement.

Closes #778

@alex-snezhko alex-snezhko changed the title Record spread feat(compiler): Record spread syntax Dec 30, 2022
Copy link
Member

@ospencer ospencer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking really stellar! Just a couple of questions from me but this looks like it'll be ready to land pretty soon :)

compiler/src/parsing/ast_helper.re Outdated Show resolved Hide resolved
compiler/src/parsing/parser.messages Outdated Show resolved Hide resolved
compiler/src/parsing/parser.messages Show resolved Hide resolved
compiler/src/parsing/parser.messages Outdated Show resolved Hide resolved
compiler/src/typed/typecore.re Outdated Show resolved Hide resolved
Copy link
Member

@phated phated left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing I saw from my phone

compiler/test/formatter_outputs/records.gr Outdated Show resolved Hide resolved
Copy link
Member

@ospencer ospencer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @alex-snezhko! Awesome work here 😄

@ospencer ospencer requested a review from phated January 5, 2023 22:56
@ospencer
Copy link
Member

ospencer commented Jan 5, 2023

Looks like you need a npm run compiler format.

@ospencer
Copy link
Member

ospencer commented Jan 5, 2023

Jinx :P

Copy link
Member

@phated phated left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is fantastic. I saw a few things (mostly questions) but overall it was a delight to review!

compiler/src/middle_end/linearize.re Outdated Show resolved Hide resolved
compiler/src/middle_end/linearize.re Show resolved Hide resolved
compiler/src/parsing/ast_helper.re Outdated Show resolved Hide resolved
compiler/src/parsing/parser.messages Show resolved Hide resolved
Copy link
Member

@phated phated left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Record spread syntax
4 participants