mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-30 01:04:49 -05:00
Don't widen unique symbols annotated by effective type nodes in JS files (#61180)
This commit is contained in:
committed by
GitHub
parent
2c3be449ff
commit
7507b055de
@@ -11821,7 +11821,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
}
|
||||
|
||||
// always widen a 'unique symbol' type if the type was created for a different declaration.
|
||||
if (type.flags & TypeFlags.UniqueESSymbol && (isBindingElement(declaration) || !declaration.type) && type.symbol !== getSymbolOfDeclaration(declaration)) {
|
||||
if (type.flags & TypeFlags.UniqueESSymbol && (isBindingElement(declaration) || !tryGetTypeFromEffectiveTypeNode(declaration)) && type.symbol !== getSymbolOfDeclaration(declaration)) {
|
||||
type = esSymbolType;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user