From 914f9bbed59b1503a01affb1da381226eccdb5e6 Mon Sep 17 00:00:00 2001 From: Gerrit Birkeland Date: Mon, 1 Jan 2024 08:25:52 -0700 Subject: [PATCH] Fix infinite loop Resolves #2468 --- CHANGELOG.md | 4 ++++ src/lib/converter/types.ts | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5210c4810..c7735a907 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Unreleased +### Bug Fixes + +- Fixed infinite loop caused by a fix for some complicated union/intersection types, #2468. + ## v0.25.5 (2024-01-01) ## Features diff --git a/src/lib/converter/types.ts b/src/lib/converter/types.ts index 8c766adc3..9cb752a65 100644 --- a/src/lib/converter/types.ts +++ b/src/lib/converter/types.ts @@ -135,10 +135,12 @@ export function convertType( // TS 4.2 added this to enable better tracking of type aliases. // We need to check it here, not just in the union checker, because typeToTypeNode // will use the origin when serializing + // aliasSymbol check is important - #2468 if ( typeOrNode.isUnion() && typeOrNode.origin && - !typeOrNode.origin.isUnion() + !typeOrNode.origin.isUnion() && + !typeOrNode.aliasSymbol ) { return convertType(context, typeOrNode.origin); }