-
Notifications
You must be signed in to change notification settings - Fork 15
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
TSC in isolated declaration will still use the type checker to print types #129
TSC in isolated declaration will still use the type checker to print types #129
Conversation
Signed-off-by: Titian Cernicova-Dragomir <tcernicovad1@bloomberg.net>
Signed-off-by: Titian Cernicova-Dragomir <tcernicovad1@bloomberg.net>
Signed-off-by: Titian Cernicova-Dragomir <tcernicovad1@bloomberg.net>
3da49c4
to
fb08ff8
Compare
...rence/isolated-declarations/auto-fixed/diff/declarationEmitObjectLiteralAccessors1.d.ts.diff
Outdated
Show resolved
Hide resolved
...ce/isolated-declarations/original/diff/mappedTypeWithAsClauseAndLateBoundProperty2.d.ts.diff
Outdated
Show resolved
Hide resolved
currentExportsSymbolTable = exports; | ||
if (isBlockScopedContainerTopLevel(scope)) { |
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.
Can you explain a bit what the effect of this and related code separating a function local table? I don't think I fully understand the flow of what changed here.
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.
Initially we didn't go into blocks however I recently found that TS will add expando members from nested blocks. Ex:
function Foo() {}
if(Math.random()) { Foo.test = 1; }
{ Foo. bar =2; }
This means that we now do care about variables defined in blocks and the fact that they are only scoped to that block since that means any member accesses in that block will not add expando members to any variable that is shadowed in that scope:
function Foo() {}
if(Math.random()) { Foo.test = 1; }
{ let Foo: any = {}; Foo. bar =2; } // bar not on Foo
(TS also handled this incorrectly until recently: microsoft#56538)
Signed-off-by: Titian Cernicova-Dragomir <tcernicovad1@bloomberg.net>
Signed-off-by: Titian Cernicova-Dragomir <tcernicovad1@bloomberg.net>
bb439ac
to
2c0bf81
Compare
This revealed some differences between TSC and DTE type printing.