Skip to content

Commit 914f9bb

Browse files
committed
Fix infinite loop
Resolves #2468
1 parent 3e2240c commit 914f9bb

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Unreleased
22

3+
### Bug Fixes
4+
5+
- Fixed infinite loop caused by a fix for some complicated union/intersection types, #2468.
6+
37
## v0.25.5 (2024-01-01)
48

59
## Features

src/lib/converter/types.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,12 @@ export function convertType(
135135
// TS 4.2 added this to enable better tracking of type aliases.
136136
// We need to check it here, not just in the union checker, because typeToTypeNode
137137
// will use the origin when serializing
138+
// aliasSymbol check is important - #2468
138139
if (
139140
typeOrNode.isUnion() &&
140141
typeOrNode.origin &&
141-
!typeOrNode.origin.isUnion()
142+
!typeOrNode.origin.isUnion() &&
143+
!typeOrNode.aliasSymbol
142144
) {
143145
return convertType(context, typeOrNode.origin);
144146
}

0 commit comments

Comments
 (0)