Skip to content

Commit 63387bb

Browse files
committed
Error on circular constraints in mapped types
1 parent 2646828 commit 63387bb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/compiler/checker.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6059,6 +6059,9 @@ namespace ts {
60596059
type.aliasSymbol = getAliasSymbolForTypeNode(node);
60606060
type.aliasTypeArguments = getAliasTypeArgumentsForTypeNode(node);
60616061
links.resolvedType = type;
6062+
// Eagerly resolve the constraint type which forces an error if the constraint type circularly
6063+
// references itself through one or more type aliases.
6064+
getConstraintTypeFromMappedType(type);
60626065
}
60636066
return links.resolvedType;
60646067
}

0 commit comments

Comments
 (0)