We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 09da98b commit a75449cCopy full SHA for a75449c
src/compiler/checker.ts
@@ -20605,8 +20605,7 @@ namespace ts {
20605
}
20606
20607
function checkInferType(node: InferTypeNode) {
20608
- const ancestor = findAncestor(node, n => n.parent && n.parent.kind === SyntaxKind.ConditionalType);
20609
- if (!ancestor || (<ConditionalTypeNode>ancestor.parent).extendsType !== ancestor) {
+ if (!findAncestor(node, n => n.parent && n.parent.kind === SyntaxKind.ConditionalType && (<ConditionalTypeNode>n.parent).extendsType === n)) {
20610
grammarErrorOnNode(node, Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type);
20611
20612
checkSourceElement(node.typeParameter);
0 commit comments