-
Notifications
You must be signed in to change notification settings - Fork 483
destructure record rest elements #8317
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
Open
tsnobip
wants to merge
32
commits into
master
Choose a base branch
from
fix-8311
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
01b10ab
destructure record rest elements - fixes #8311
tsnobip f353016
support type with parameter for record rest
tsnobip 6108216
simplify parsing of record rest
tsnobip f9c6325
update record spread error message
tsnobip 906df32
improve error message of superfluous fields in rest
tsnobip 77ccbcf
improve error message of non optional rest field already matched
tsnobip 453d89f
add a warning when rest record would be empty
tsnobip 23ea968
add fixture tests for error/warning messages
tsnobip 0841f1d
add changelog
tsnobip aaecac9
address comments (parsetree0 PPX roundtrips, nested rest, etc)
tsnobip ca77e9c
support rest of inline record
tsnobip 42c6f9c
check rest field types, fix matching & invalid field identifier
tsnobip 68e0ebb
fix rest of private type and analysis
tsnobip 83a7006
use runtime field names for rest
tsnobip e667382
support record type alias in rest
tsnobip 049aaed
fix compiler crash when spreading the whole record
tsnobip b47e43c
disallow rest spreading on packed modules
tsnobip b092cb8
add tests for record rest with namespaced type
tsnobip fbc1735
make sure rest is used and move logic to its own files
tsnobip 53f864c
stop ignoring _rest in a few more places
tsnobip e0c41c8
format
tsnobip bcc6c80
improve output (compile to JS destructuring)
tsnobip 88378e1
update changelog
tsnobip ef5a66a
remove leading _ of used variable
tsnobip 0029c83
add more tests
tsnobip 19a5c97
disallow spreading rest to unboxed record
tsnobip 30fcfbf
address https://github.com/rescript-lang/rescript/pull/8317#discussio…
tsnobip 633c6ad
document type_record_pat_rest function
tsnobip 95022a9
add comment about Tpat_record rest
tsnobip fe82b90
forbid destructure to rest of record with mutable fields
tsnobip 2250243
do not spread function params to avoid issues with 'use strict'
tsnobip a87f7f9
fix comment table for rest spread
tsnobip File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When
analyze_typesis enabled, this branch records only the explicit record field labels and ignores the new_restpayload. Since the typed-tree mapper also leavesrecord_pat_restuntouched, a type referenced only by a rest annotation such as...SubConfig.t as restgets no reference recorded and can be reported or removed as dead even though the code needs it.Useful? React with 👍 / 👎.