Repository navigation
Limit when we allow nested unique symbols to be serialized - #40886
Merged
Wesley Wigham (weswigham) merged 1 commit intoOct 5, 2020
Conversation
…eir declaration is within the same file as the context
Wesley Wigham (weswigham)
requested review from
Andrew Branch (andrewbranch) and
Nathan Shively-Sanders (sandersn)
October 1, 2020 22:23
| export const A: AX = 0 as any; | ||
| ==== tests/cases/compiler/b.ts (1 errors) ==== | ||
| import { A } from './a'; | ||
| export const A1 = A; |
There was a problem hiding this comment.
Wait, why couldn’t it just serialize as typeof A (or typeof import('./a').A if the import gets erased) here?
Member
Author
There was a problem hiding this comment.
I said as why in the issue, but I'll restate it here: because that could only work for specific patterns of assignments, and while we may carve out syntactic patterns for checking JS, we do not for TS. So because it doesn't generalize beyond var x = entity.name assignments to all assignments, it doesn't make sense to do, really.
Nathan Shively-Sanders (sandersn)
approved these changes
Oct 5, 2020
Wesley Wigham (weswigham)
deleted the
error-on-anonymous-type-with-nonlocal-unique-symbol
branch
October 5, 2020 18:59
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
to when their declaration is within the same file as the context. Within the same context, the symbol should be referred to by
typeof declname(or be the declarationunique symbolnode itself), so this should be sufficient.Fixes #40786