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

Fix panic when interpolating fields in a record type #1332

Merged
merged 3 commits into from
May 30, 2023

Conversation

jneem
Copy link
Member

@jneem jneem commented May 30, 2023

Previously, we would panic on {"%{a}": Number}. This makes it an error instead, with an error message about record types not allowing interpolation in fields.

There's another option here, which is to update is_record_type to check for the presence of interpolation, but I opted against it because I thought the error message was worse: since it would see that parsing as a record type would fail, it would fall back to parsing as a record literal and then fail later with error: statically typed field without a definition.

The same choice will come up in #1284

@github-actions github-actions bot temporarily deployed to pull request May 30, 2023 18:08 Inactive
@github-actions github-actions bot temporarily deployed to pull request May 30, 2023 18:33 Inactive
@jneem jneem added this pull request to the merge queue May 30, 2023
Merged via the queue into master with commit 2056f74 May 30, 2023
4 checks passed
@jneem jneem deleted the record-type-field-interpolation branch May 30, 2023 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants