-
-
Notifications
You must be signed in to change notification settings - Fork 496
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
feat(semantic): add some scopes to align TypeScript's container #3969
feat(semantic): add some scopes to align TypeScript's container #3969
Conversation
Your org has enabled the Graphite merge queue for merging into mainAdd the label “merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix. You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link. |
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
CodSpeed Performance ReportMerging #3969 will not alter performanceComparing Summary
|
c673495
to
44587fa
Compare
44587fa
to
cbd672e
Compare
@@ -237,6 +238,7 @@ pub struct TSConditionalType<'a> { | |||
pub extends_type: TSType<'a>, | |||
pub true_type: TSType<'a>, | |||
pub false_type: TSType<'a>, | |||
pub scope_id: Cell<Option<ScopeId>>, |
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.
Would Option<Cell<ScopeId>>
be better or worse?
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.
It has to be Cell<Option<ScopeId>>
because the Option
value needs to be mutated from None
to Some(...)
with only an immutable &TSConditionalType
(in Semantic
).
cbd672e
to
86b4b58
Compare
b6ef7ca
to
53efc22
Compare
df02c40
to
f676841
Compare
53efc22
to
c46b60d
Compare
e88e957
to
e9192fb
Compare
c46b60d
to
1244aab
Compare
e9192fb
to
2f41660
Compare
1244aab
to
5c75f05
Compare
2f41660
to
f171c7e
Compare
f171c7e
to
dc2b3c4
Compare
Superseded by #4280 |
close: #3969 close: #2023 We need to add scope according to [this](https://github.com/microsoft/TypeScript/blob/d8086f14b6b97c0df34a0cc2f56d4b5926a0c299/src/compiler/binder.ts#L3883-L3962). There are still some ASTs that need to be added to the scope. --- Context from @Boshen: Before this whole journey of fixing symbols and scopes I asked @Dunqing to debug through binder.ts via a debugger to fully understand how it does resolution. We then agreed to align the implementation so that when a problem occurs, we can debug through both implementations and find where our problem is. tsc doesn't have a specification, so we need to align with the reference implementation instead.
This pr is a prototype to fix #2023. We have added scope to some nodes