Skip to content

Commit 1575b7a

Browse files
committed
Fix parent node walk termination condition in getConstrainedTypeVariable
1 parent da32f2b commit 1575b7a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7395,7 +7395,7 @@ namespace ts {
73957395

73967396
function getConstrainedTypeVariable(typeVariable: TypeVariable, node: Node) {
73977397
let constraints: Type[];
7398-
while (isPartOfTypeNode(node)) {
7398+
while (node && !isStatement(node)) {
73997399
const parent = node.parent;
74007400
if (parent.kind === SyntaxKind.ConditionalType && node === (<ConditionalTypeNode>parent).trueType) {
74017401
const constraint = getImpliedConstraint(typeVariable, (<ConditionalTypeNode>parent).checkType, (<ConditionalTypeNode>parent).extendsType);

0 commit comments

Comments
 (0)