Limit when we allow nested unique symbols to be serialized to when their declaration is within the same file as the context

This commit is contained in:
Wesley Wigham
2020-10-01 15:20:01 -07:00
parent da86332120
commit b86dc34386
6 changed files with 82 additions and 1 deletions

View File

@@ -5812,7 +5812,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);