-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent panic when parsing record type with field path (#1325)
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.
- Loading branch information
1 parent
9a2e2fc
commit afdaff5
Showing
3 changed files
with
36 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# test.type = 'error' | ||
# eval = 'typecheck' | ||
# | ||
# [test.metadata] | ||
# error = 'ParseError::TypedFieldWithoutDefinition' | ||
{ x.y : Number } |