Fix a logic-changing typo in getRecursionIdentity (#54321)

This commit is contained in:
Ruben Tytgat
2023-05-22 19:34:05 +02:00
committed by GitHub
parent 996aeb6aaf
commit 0bfc9f51ec

View File

@@ -22990,7 +22990,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
function getRecursionIdentity(type: Type): object {
// Object and array literals are known not to contain recursive references and don't need a recursion identity.
if (type.flags & TypeFlags.Object && !isObjectOrArrayLiteralType(type)) {
if (getObjectFlags(type) && ObjectFlags.Reference && (type as TypeReference).node) {
if (getObjectFlags(type) & ObjectFlags.Reference && (type as TypeReference).node) {
// Deferred type references are tracked through their associated AST node. This gives us finer
// granularity than using their associated target because each manifest type reference has a
// unique AST node.