mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-16 07:13:45 -05:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user