Merge pull request #40886 from weswigham/error-on-anonymous-type-with-nonlocal-unique-symbol

Limit when we allow nested unique symbols to be serialized
This commit is contained in:
Wesley Wigham
2020-10-05 11:59:45 -07:00
committed by GitHub
6 changed files with 82 additions and 1 deletions

View File

@@ -5820,7 +5820,7 @@ namespace ts {
}
const oldFlags = context.flags;
if (type.flags & TypeFlags.UniqueESSymbol &&
type.symbol === symbol) {
type.symbol === symbol && (!context.enclosingDeclaration || some(symbol.declarations, d => getSourceFileOfNode(d) === getSourceFileOfNode(context.enclosingDeclaration!)))) {
context.flags |= NodeBuilderFlags.AllowUniqueESSymbolType;
}
const result = typeToTypeNodeHelper(type, context);