-
-
Notifications
You must be signed in to change notification settings - Fork 166
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
chore(ts/checker): Enable destructuringArrayBindingPatternAndAssignment3 #298
Merged
kdy1
merged 14 commits into
dudykr:main
from
Beraliv:conformance/destructuringArrayBindingPatternAndAssignment3
Nov 24, 2022
Merged
chore(ts/checker): Enable destructuringArrayBindingPatternAndAssignment3 #298
kdy1
merged 14 commits into
dudykr:main
from
Beraliv:conformance/destructuringArrayBindingPatternAndAssignment3
Nov 24, 2022
Conversation
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
add crates/stc_ts_file_analyzer/tests/pass/es6/destructuring/destructuri ngArrayBindingPatternAndAssignment3/.6.ts
Added crates/stc_ts_file_analyzer/tests/pass/es6/destructuring/destructu ringArrayBindingPatternAndAssignment3/.6.ts
Beraliv
commented
Nov 15, 2022
kdy1
reviewed
Nov 16, 2022
@@ -2067,6 +2067,18 @@ impl Analyzer<'_, '_> { | |||
// TODO: Handle Type::Rest | |||
|
|||
if elems.len() > rhs_elems.len() { | |||
let is_lhs_any_tuple = elems.iter().all(|l| match *l.ty { |
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.
Is this correct? I think we should leverage the optional type as you said in #181 (comment)
…ringArrayBindingPatternAndAssignment3
line duplication
kdy1
approved these changes
Nov 24, 2022
Beraliv
deleted the
conformance/destructuringArrayBindingPatternAndAssignment3
branch
November 24, 2022 10:44
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description:
I simply ignore
AssignFailedBecauseTupleLengthDiffers
when there is a tuple withany
elements for lhs.The only regression is
conformance::expressions::arrayLiterals::arrayLiterals3.ts
wherevar a0: [any, any, any] = []
is PASSED without errors now (which is wrong).Can you please recommend a way to distinguish tuple in parameters and tuple in variables?
But we will need to distinguish these cases in the future for sure:
Playground 🔗 – https://tsplay.dev/w8xO9w
BREAKING CHANGE:
Related issue (if exists): #181