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

Prevent panic when parsing record type with field path #1325

Merged
merged 1 commit into from
May 26, 2023

Conversation

matthew-healy
Copy link
Contributor

@matthew-healy matthew-healy commented May 26, 2023

Nickel does not support record types with field paths. i.e. while this is a valid type:

{ x : { y : String } }

this is not:

{ x.y : String }

However, at some point rather than raising the appropriate error here, we started panicking. This commit fixes that by checking that a field's path only contains a single element before deciding whether to allow it in a record type.

Fixes #1317.

Nickel does not support record types with field paths. i.e. while this
is a valid type:

```
{ x : { y : String } }
```

this is not:

```
{ x.y : String }
```

However, at some point rather than raising the appropriate error here,
we started panicking. This commit fixes that by checking that a field's
path only contains a single element before deciding whether to allow
it in a record type.
@matthew-healy matthew-healy marked this pull request as ready for review May 26, 2023 12:35
@github-actions github-actions bot temporarily deployed to pull request May 26, 2023 12:40 Inactive
@matthew-healy matthew-healy added this pull request to the merge queue May 26, 2023
Merged via the queue into master with commit afdaff5 May 26, 2023
@matthew-healy matthew-healy deleted the fix/typed-field-path-panic branch May 26, 2023 14:35
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.

Panic when parsing record type with field paths
2 participants